PDA

View Full Version : When game restarts, does not run correctly, how can I fix?



glovaxlr
August 3rd, 2009, 08:26 PM
Hi guys! I'm making a game.. here's the source.


http://willhostforfood.com/files4/9/6/0/9602464/spotlight_finalfla.png (http://willhostforfood.com/access.php?fileid=77883)

When you fail a level, screen comes up asking you to click to restart. When you do this, it goes back to the front screen, but you no longer have any control of the game, or the cursor. how do I fix this?

thanks for your time!

SparK_BR
August 4th, 2009, 07:43 PM
quick fix:


if (score==0) {
myTimer.stop();
gotoAndPlay("fail");
Mouse.show();
stage.removeEventListener(Event.ENTER_FRAME, checkScore);
removeEventListener(Event.ENTER_FRAME, checkCollision);
}
but don't copy paste the code of the whole game for each level in your next project ok?

as TOdorus would say: "That goes into the 'too bad' box."