pause game.
I haveif(engine.pPressed && !pauseGame){
pauseGame =true;
countergamePause = 10;
}
if(pauseGame){
if(engine.pPressed){
pauseGame =false;
}
return;
}
But that only pauses the game if i hold down the p button. ANy clues why? anyways to pause it?
[675 byte] By [
krrose27a] at [2007-11-27 4:32:37]

# 2
if(engine.pPressed && !pauseGame){// p is press key event listener is in the engine class & the booleand pause game is no tru the set it true.
pauseGame = true;//pause game
}
if(pauseGame){//if the game is pause
if(engine.pPressed){/if the p is pressed
pauseGame = false;//unpause game
}
return;//else return
}
# 4
I was going to say you needed else if instead of if for the second part, but you found that on your own.
Depending on the OS, Key events can be fired in rapid succession. Typically a quick press of the key gives you 3 key events, a press, type, and release. If you hold it down, you could end up with these events being fired repeatedly. Look at how each of these events is handled, or post that code.