javascript - Added a pause function that wont work. Anyone know a solution? -


this question exact duplicate of:

i have added pause function game:

function pausegame() {     if (!gamepaused) {         game = cleartimeout(game);         gamepaused = true;     } else if (gamepaused) {         game = settimeout(drawgame, speed - (level * 50));         gamepaused = false;     } }; 

but reason, wont pause game. can figure out why wont work? game here.

you need set game first time call settimeout(). otherwise when cleartimeout(game), throws error (and doesn't set gamepaused true).


Popular posts from this blog

Php - Delimiter must not be alphanumeric or backslash -

trac - Modifying workflow to add a status and split on ticket type -

Delphi interface implements -