how can i make this code react faster???
i want it to move the thing faster like the second you press watever it will go down so far this just takes a second to react thx Code Credits go to skeletron
Code:
Dim Hi As Integer
Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
If e.KeyChar = Chr(Asc("w")) Then
Button1.Location = New Point(Button1.Location.X, Button1.Location.Y - 4)
ElseIf e.KeyChar = Chr(Asc("d")) Then
Button1.Location = New Point(Button1.Location.X + 4, Button1.Location.Y)
ElseIf e.KeyChar = Chr(Asc("a")) Then
Button1.Location = New Point(Button1.Location.X - 4, Button1.Location.Y)
ElseIf e.KeyChar = Chr(Asc("s")) Then
Button1.Location = New Point(Button1.Location.X, Button1.Location.Y + 4)
ElseIf e.KeyChar = Chr(Asc("q")) Then
Hi = Hi + 1
PictureBox1.Image = Image.FromFile("C:\Documents and Settings\Jaco\My Documents\My Pictures\Move 2.bmp")
If Hi = 2 Then
PictureBox1.Image = Image.FromFile("C:\Documents and Settings\Jaco\My Documents\My Pictures\Move 1.bmp")
Hi = 0
End If
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
PictureBox1.Image = Image.FromFile("C:\Documents and Settings\Jaco\My Documents\My Pictures\Move 1.bmp")
End Sub
i want it to move the thing faster like the second you press watever it will go down so far this just takes a second to react thx Code Credits go to skeletron




