Im looking to make a key delay for my game, so that when the space bar is pressed it wont keep shooting my bullets but will have a half second delay. If you post code please comment it ! thx
Printable View
Im looking to make a key delay for my game, so that when the space bar is pressed it wont keep shooting my bullets but will have a half second delay. If you post code please comment it ! thx
When you boot the computer, go into setup and set the repeat delay to 500ms.
What you can do is have a global variable that has the time of when the space bar(or shoot button) is pressed. So when they press it, it checks if the time difference between now and the last time they pressed it is greater than half a second. If its greater than the half a second (or whatever value is reasonable) then shoot the bullet and set the variable to the current time.
Also make sure you only check the the shoot button is pressed when you are checking the difference in the times, or they wont be able to control the ship very well lol.
What code? What language are you using? We need some more information than just "show me code".
chem
vb6........