Could you add an eventlistener to disable your arrow keys and spacebar under normal circumstances? That will keep the page from scrolling up and down while playing the game (Same applies to the spacebar). This should not impact anyone adding comments since the game is embedded in an iframe (or some equivalent).
Within the keyup brackets ('ArrowUp', 'ArrowDown', 'Space), you can add e.preventDefault(); along with your variable updates
â Return to game
Comments
Log in with itch.io to leave a comment.
Could you add an eventlistener to disable your arrow keys and spacebar under normal circumstances? That will keep the page from scrolling up and down while playing the game (Same applies to the spacebar). This should not impact anyone adding comments since the game is embedded in an iframe (or some equivalent).
Within the keyup brackets ('ArrowUp', 'ArrowDown', 'Space), you can add e.preventDefault(); along with your variable updates
Example:
if(e.code == 'ArrowUp') { e.preventDefault(); upPressed = true }Yea! Really cool! I love the effect when the enemies explode. Almost like particles!
nice game, very fun, it would be great if you added more stuff to it maybe some upgrades, for the tank, and the enemies could come in waves