View Full Version : [AS2] Restarting a basic game

03-28-2007, 11:11 AM
I have a basic hang man style game which records the name of the player and keeps a running score of wins and losses, but I want to implement a 'restart' which takes the back to the point where a player can enter their name (to start a 'New Game')

Im completly confused on how to do this as simply closing the game by various menthods doesnt erase the information.

Can anyone help?

03-28-2007, 03:40 PM
first off any variables your storing you have to set to null or blank.
then take them back to the first frame or wherever it starts

//clear vars

Since we dont know the structure of your game or how you programmed it specifics are hard to pin down, however a good idea would be to have a frame at the beginning of your movie that actually handles all the re-setting of variables, clips, etc. Then when you want to re-set your game you can just shoot them to that frame.

(the frame can really be at the end or the beginning, as long as when its done it sends the playhead to the appropriate starting frame) Also you can label the frame something like "reset" and then just go



03-29-2007, 10:14 AM
I have got a restart 'kind of' working in my game, I have made a button with this code attached;

on (release) {
delete localinfo.data.user;
delete localinfo.data.lossScore;
delete localinfo.data.winScore;
gotoAndPlay("Scene 1", 1);

This dumps out all of the user data and returns the game to the first screen so you can enter a name, problem is it als displays the in game menu for the hangman game at the same time.

Can anyone give any advice?