Guest_imported
New member
- Jan 1, 1970
- 0
i am trying to write a game in which the character wanders around a map, killing fiends, finding items, and such. (ever play zelda for the NES?)
anyway, my problem is this: if you hold down the arrow key, it just keeps filling the keyboard buffer untill my comp starts beeping at me, and then continues the walking animation for some time after letting go. i am handling keyboard input as follows:
kb:
do: k$ = inkey$
loop while k$ = ""
select case k$
case chr$(0) + "H": gosub mvup ' *up*
case chr$(0) + "P": gosub mvdn ' *down*
case chr$(0) + "K": gosub mvlt ' *left*
case chr$(0) + "M": gosub mvrt ' *right*
case chr$(27): end
end select
goto kb
is there a way to clear the kb buffer? or even a better way to read the kb?
i have heard about people using peek to scan the kb, but i dunno where to peek.
also, i tried the "on key(n%) gosub label" command, but couldn't get the arrow keys to work.
any help or advice would be super appreciated.
anyway, my problem is this: if you hold down the arrow key, it just keeps filling the keyboard buffer untill my comp starts beeping at me, and then continues the walking animation for some time after letting go. i am handling keyboard input as follows:
kb:
do: k$ = inkey$
loop while k$ = ""
select case k$
case chr$(0) + "H": gosub mvup ' *up*
case chr$(0) + "P": gosub mvdn ' *down*
case chr$(0) + "K": gosub mvlt ' *left*
case chr$(0) + "M": gosub mvrt ' *right*
case chr$(27): end
end select
goto kb
is there a way to clear the kb buffer? or even a better way to read the kb?
i have heard about people using peek to scan the kb, but i dunno where to peek.
also, i tried the "on key(n%) gosub label" command, but couldn't get the arrow keys to work.
any help or advice would be super appreciated.