hi, I am making a game that involves using the arrow keys I have been using the keydown function for the form but when i use it now all the timers seem to stop. this was my previous code for the arrow keys using the keydown function:
now i am trying to use a timer to use the arrow keys and i am using thisCode:If e.keydata = keys.up Then If pbxship.Top <= 77 Then pbxship.Top += 10 Else pbxship.Top -= 10 End If ElseIf e.keydate = keys.down Then If pbxship.Top >= 800 Then PbxLazer.Top -= 10 Else pbxship.Top += 10 End If
but this does not do anything like the keys are not pressed, does anyone know how to make it work or a different way to do this in a timerCode:Private Declare Function GetKeyState Lib "user32" (ByVal keyCode As Integer) As Short If GetKeyState(Keys.Up) Then If pbxship.Top <= 77 Then pbxship.Top += 10 Else pbxship.Top -= 10 End If ElseIf GetKeyState(Keys.Down) Then If pbxship.Top >= 800 Then PbxLazer.Top -= 10 Else pbxship.Top += 10 End If
thanks in advance




Reply With Quote
