Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Form1_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown
- If e.KeyValue = Keys.Shift Then
- WSpeed = 15
- End If
- If e.KeyValue = Keys.D Then
- WRight = True
- WLeft = False
- Wizard.Image = Image.FromFile("C:\Users\kungf_000\Desktop\New my games\Wizard\wizard-right.png")
- End If
- If e.KeyValue = Keys.A Then
- WLeft = True
- WRight = False
- Wizard.Image = Image.FromFile("C:\Users\kungf_000\Desktop\New my games\Wizard\wizard-left.png")
- End If
- If e.KeyValue = Keys.W Then
- WForward = True
- Wizard.Image = Image.FromFile("C:\Users\kungf_000\Desktop\New my games\Wizard\wizard-back.png")
- End If
- If e.KeyValue = Keys.S Then
- WBackwards = True
- Wizard.Image = Image.FromFile("C:\Users\kungf_000\Desktop\New my games\Wizard\wizard-front.png")
- End If
- If e.KeyValue = Keys.Up And WizardShot1.Visible = False Then
- WizardShot1.Top = Wizard.Top
- WizardShot1.Left = Wizard.Left + (Wizard.Width / 2) - (WizardShot1.Width / 2)
- WizardShot1.Visible = True
- WizardShot1.Image = Image.FromFile("C:\Users\kungf_000\Desktop\New my games\Shots\WizardShot\shot-up.png")
- End If
- If e.KeyValue = Keys.Down And WizardShot2.Visible = False Then
- WizardShot2.Top = Wizard.Bottom
- WizardShot2.Left = Wizard.Left + (Wizard.Width / 2) - (WizardShot2.Width / 2)
- WizardShot2.Visible = True
- WizardShot2.Image = Image.FromFile("C:\Users\kungf_000\Desktop\New my games\Shots\WizardShot\shot-down.png")
- End If
- If e.KeyValue = Keys.Left And WizardShot3.Visible = False Then
- WizardShot3.Top = Wizard.Top
- WizardShot3.Left = Wizard.Left + (Wizard.Height / 2) - (WizardShot3.Height / 2)
- WizardShot3.Visible = True
- WizardShot3.Image = Image.FromFile("C:\Users\kungf_000\Desktop\New my games\Shots\WizardShot\shot-left.png")
- End If
- If e.KeyValue = Keys.Right And WizardShot4.Visible = False Then
- WizardShot4.Top = Wizard.Top
- WizardShot4.Left = Wizard.Left + (Wizard.Height / 2) - (WizardShot4.Height / 2)
- WizardShot4.Visible = True
- WizardShot4.Image = Image.FromFile("C:\Users\kungf_000\Desktop\New my games\Shots\WizardShot\shot-right.png")
- End If
- End Sub
- Private Sub moveEnemy()
- Dim x As Integer
- Dim speed As Integer = 1
- Dim pos As Point
- Dim CreatureCollision As Boolean
- If Wizard.Location.X < Golem.Location.X And EnemyCollision(Golem, CreatureCollision) = False Then
- Golem.Image = Image.FromFile("C:\Users\kungf_000\Desktop\New my games\Golem\golem-left.png")
- Golem.Left -= speed
- ElseIf EnemyCollision(Golem, CreatureCollision) = True Then
- Golem.Left -= 5
- CreatureCollision = False
- End If
- If Wizard.Location.X > Golem.Location.X And EnemyCollision(Golem, CreatureCollision) = False Then
- Golem.Image = Image.FromFile("C:\Users\kungf_000\Desktop\New my games\Golem\golem-right.png")
- Golem.Left += speed
- ElseIf EnemyCollision(Golem, CreatureCollision) = True Then
- Golem.Left += 5
- CreatureCollision = False
- End If
- If Wizard.Location.Y > Golem.Location.Y And EnemyCollision(Golem, CreatureCollision) = False Then
- Golem.Image = Image.FromFile("C:\Users\kungf_000\Desktop\New my games\Golem\golem-front.png")
- Golem.Top += speed
- ElseIf EnemyCollision(Golem, CreatureCollision) = True Then
- Golem.Top += 5
- CreatureCollision = False
- End If
- If Wizard.Location.Y < Golem.Location.Y And EnemyCollision(Golem, CreatureCollision) = False Then
- Golem.Image = Image.FromFile("C:\Users\kungf_000\Desktop\New my games\Golem\golem-back.png")
- Golem.Top -= speed
- ElseIf EnemyCollision(Golem, CreatureCollision) = True Then
- Golem.Top -= 5
- CreatureCollision = False
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement