Just a note about _KeyClear, it won't help with _KeyDown(), it will clear Inkey$ or _KeyHit.
This is interesting:
Instead of _KeyClear you could set ky = 0 but it would be more direct to just execute code like if left arrow then x = x-1 if right arrow then x = x+1, if up arrow then y = y - 1, if down arrow then y = y + 1.
You don't need any GetKey sub with _Keydown(), again it tells you immediately when key number is being held down.
Your problem with _keydown is going to be getting user to release key so several calls doing same thing aren't executed but my alternate suggestion is good for moving character around screen.
Quick HeroX, HeroY moving on screen:
This is interesting:
Code: (Select All)
If _KeyDown(18432) Then ky = ky + 1
If _KeyDown(19200) Then ky = ky + 2
If _KeyDown(19712) Then ky = ky + 4
If _KeyDown(20480) Then ky = ky + 8
You don't need any GetKey sub with _Keydown(), again it tells you immediately when key number is being held down.
Your problem with _keydown is going to be getting user to release key so several calls doing same thing aren't executed but my alternate suggestion is good for moving character around screen.
Quick HeroX, HeroY moving on screen:
Code: (Select All)
Screen _NewImage(800, 600, 32)
_ScreenMove 250, 50
heroX = 400: heroY = 300 ' middle
Do
Cls
Circle (heroX, heroY), 10
If _KeyDown(19200) Then heroX = heroX - 5
If _KeyDown(19712) Then heroX = heroX + 5
If _KeyDown(18432) Then heroY = heroY - 5
If _KeyDown(20480) Then heroY = heroY + 5
_Limit 10
Loop
b = b + ...