Private Sub melee_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles melee.Click
melee.Enabled = False
Dim random2 As New Random()
Dim ran2 As Integer = random2.Next(1, 7)
If ran2 = 1 Then
enemy1.Hide()
enemy1fast.Show()
Dim soundplayer1 As New Media.SoundPlayer(My.Resources._throw)
soundplayer1.Play()
Dim Increment As Integer = 1
Dim R, G, B As Integer
R = 0
G = 0
B = 0
Label9.BackColor = Color.Black
Application.DoEvents()
For i As Integer = 30 To 70
R += Increment
B += Increment
G += Increment
Label9.BackColor = Color.FromArgb(R, G, B)
Application.DoEvents()
System.Threading.Thread.Sleep(10)
Next
enemy1fast.Hide()
enemy1hit.Show()
gethit1.Show()
Player1.Hide()
Dim soundplayer2 As New Media.SoundPlayer(My.Resources.strongpunch)
soundplayer2.Play()
R = 0
G = 0
B = 0
Label9.BackColor = Color.Black
Application.DoEvents()
For i As Integer = 1 To 40
R += Increment
B += Increment
G += Increment
Label9.BackColor = Color.FromArgb(R, G, B)
Application.DoEvents()
System.Threading.Thread.Sleep(10)
Next
hplabel.Text -= 50
hplabel2.Text -= 50
enemy1hit.Hide()
gethit1.Hide()
enemy1.Show()
If hplabel2.Text < 1 Then
playerdead.Show()
Dim soundplayer0 As New Media.SoundPlayer(My.Resources.deathfall)
soundplayer0.Play()
R = 0
G = 0
B = 0
Label9.BackColor = Color.Black
Application.DoEvents()
For i As Integer = 1 To 40
R += Increment
B += Increment
G += Increment
Label9.BackColor = Color.FromArgb(R, G, B)
Application.DoEvents()
System.Threading.Thread.Sleep(10)
Next
MessageBox.Show("you died!", "dead", MessageBoxButtons.OK)
Level1.Close()
Mygame.Show()
Me.Close()
End If
Player1.Show()
End If
'second randome chance of melee outcome positive
If ran2 = 2 Then
Player1.Hide()
hit2.BringToFront()
hit2.Left = 520
fastmove.Show()
Dim soundplayer1 As New Media.SoundPlayer(My.Resources.teleport)
soundplayer1.Play()
Dim Increment As Integer = 1
Dim R, G, B As Integer
R = 0
G = 0
B = 0
Label9.BackColor = Color.Black
Application.DoEvents()
For i As Integer = 50 To 70
R += Increment
B += Increment
G += Increment
Label9.BackColor = Color.FromArgb(R, G, B)
Application.DoEvents()
System.Threading.Thread.Sleep(10)
Next
enemy1.Hide()
fastmove.Hide()
hit2.Show()
cellhit.Show()
enemyhp.Text -= playerdmg1.Text
Dim soundplayer3 As New Media.SoundPlayer(My.Resources.strongkick)
soundplayer3.Play()
R = 0
G = 0
B = 0
Label9.BackColor = Color.Black
Application.DoEvents()
For i As Integer = 30 To 70
R += Increment
B += Increment
G += Increment
Label9.BackColor = Color.FromArgb(R, G, B)
Application.DoEvents()
System.Threading.Thread.Sleep(10)
Next
cellhit.Hide()
hit2.Hide()
Player1.Show()
If enemyhp.Text < 1 Then
enemy1dead.Show()
Dim soundplayer6 As New Media.SoundPlayer(My.Resources.deathfall)
soundplayer6.Play()
R = 0
G = 0
B = 0
Label9.BackColor = Color.Black
Application.DoEvents()
For i As Integer = 30 To 70
R += Increment
B += Increment
G += Increment
Label9.BackColor = Color.FromArgb(R, G, B)
Application.DoEvents()
System.Threading.Thread.Sleep(10)
Next
MessageBox.Show("You have defeated The enemy! You found $200 and your power level grew by 1000.", "victory", MessageBoxButtons.OK)
bplabel.Text += 1000
playerdmg1.Text += 3
playerdmg2.Text += 7
playerdmg3.Text += 11
playerdmg4.Text += 16
money.Text += 200
enemy1dead.Hide()
Level1.Show()
l1.hp.Text = Me.hplabel.Text
l1.mp.Text = Me.mplabel.Text
l1.bp.Text = Me.bplabel.Text
l1.water1.Text = Me.watercounter.Text
l1.food1.Text = Me.foodcounter.Text
l1.pd1.Text = Me.playerdmg1.Text
l1.pd2.Text = Me.playerdmg2.Text
l1.pd3.Text = Me.playerdmg3.Text
l1.pd4.Text = Me.playerdmg4.Text
l1.cash.Text = Me.money.Text
l1.con()
Me.Close()
End If
enemy1.Show()
End If