A question about timing and key input
Posted: Mon Feb 10, 2014 10:42 am
Hi everyone! My name is Daniel and I'm new here. I recently started learning and using ZGameEditor. After spending a great deal of time looking for a tool which allowed both visual structure as well as pure code for game creation, I found this and really started to like it.
I have since then been working on my first game using ZGameEditor, and will probably hang around on this forum a bit from now on.
I ran into a small problem though. My game curently has three states: one for the title screen, one ingame and one for a game over screen. After a certain event, the game switches to the game over screen, where score is displayed. After that the space button is used to continue and switches to the title screen state again. Here comes my problem: I also use the space button to start the game from the title screen. But the key press from the game over screen seems to carry over. So the game instantly jumps to the ingame state and skips the title screen. So my question is, is there any way to make it wait a few seconds so it will stay on the title screen until the player presses space again or can I simply clear all key-presses somehow?
I'm still very much learning this, so any help would be appreciated! Thanks!
I have since then been working on my first game using ZGameEditor, and will probably hang around on this forum a bit from now on.

I ran into a small problem though. My game curently has three states: one for the title screen, one ingame and one for a game over screen. After a certain event, the game switches to the game over screen, where score is displayed. After that the space button is used to continue and switches to the title screen state again. Here comes my problem: I also use the space button to start the game from the title screen. But the key press from the game over screen seems to carry over. So the game instantly jumps to the ingame state and skips the title screen. So my question is, is there any way to make it wait a few seconds so it will stay on the title screen until the player presses space again or can I simply clear all key-presses somehow?
I'm still very much learning this, so any help would be appreciated! Thanks!