Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21100

[RESOLVED] API help

$
0
0
Hi,
I want to know how i can move an object on screen using the GetAsyncKeyState API.
This is what i have so far,

Code:

If (GetAsyncKeyState(vbKeyRight) And &H8000) <> 0 Then
        'move right

ElseIf (GetAsyncKeyState(vbKeyRight) And &H8000) <> 0 And (GetAsyncKeyState(vbKeyUp) And &H8000) <> 0 Then
        'jump

The second API call works fine if i comment out the first and vise-versa,
how can i get it so that when only the right arrow key is pressed, the character moves right, but when both the right and up arrow keys are pressed the character jumps.

Any help will be much appreciated, thanks.

Viewing all articles
Browse latest Browse all 21100

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>