I have a game that will show a "game over" screen when the game is over. In order to start a new game from the game over screen the user is prompted to press the space bar. In my game the user presses (and can hold) the space bar to perform an attack. In my thread, if (and when) the user's or the AI's health diminishes to/or below zero then the game over screen is shown. Therefore, there is a good chance that when the game over the space bar will be down and therefore the game over screen flickers for a split second and the game is started (in order to make things smoother instead of a traditional keyPress statement I am using booleans that affect a thread which runs the repaint() function). My question is what is the syntax or command I need to put in to "imitate" the screen being released?
Asked
Active
Viewed 128 times
0
-
What if you just changed the "start game" key? That would solve the problem fairly easily – Daniel Dec 19 '12 at 19:43
-
nobody can knows what code is behind your description, for better help sooner post an [SSCCE](http://sscce.org/), demonstrated a.m. issue, short, runnable, compilable – mKorbel Dec 19 '12 at 19:50