Restart

Hey guys, how can I set it up so that when I fail a level, it restart that level when you hit restart? I have the button and everything setup and but I don't know how to make it reset the level because if I have it do previous scene, it obviously goes to the one before. Also when I do hit restart and it goes to the level before, I found a glitch in my game. I kill all the enemies and it doesn't go on to the next level unless I back out of preview and restart the whole game. What's up with that? One more thing, how can I make a menu that it shows all my levels and the locked ones have a lock on them and if you play the game and beat the level, it automatically saves it and unlocks it so if you get out of the game and start the game back up, it will show it's unlocked in the level scene. Thank you
Comments
2. I'm not sure what you mean exactly, but if the script is not working right to change scenes in the first place, and you go back to another level when you click the button that isn't working right, and it's suddenly glitchy, it's because the game is not set up to flow in that manner. Some attributes may not be getting reset, or even firing off correctly.
3. Not an easy thing to describe in a post, but basically you would set up boolean attributes that are triggered to say true or false depending on if the player successfully completes a level, and then having rules in the menu that respond to those true or false statements. Best thing is to go to GShelper.com, and download tshirtbooths free menu templates, and check those out.
this goes inside the reset actor
If anyone else has a better way to do this, please post as it would also help me
----------------------------------------------
http://davidgriffinapps.co.uk/
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
The only thing you may have to do is set some attributes back to whatever they were when you started the level originally, like the score and whatnot. Everything else will reset to it's original state.
I have issues with reset scene from time to time, and using change scene has been easier to deal with. And using reset scene has to be used in the scene you want to reset, so It won't work for you since you are in another scene for the game over screen.
Rule.
Actor Receives Event - Touch - Pressed.
Behaviour - Reset SCENE (not game)
---------------------------------
Then the Scene will start over.
You wouldn't HAVE to make a new scene for every level, but it would involve some serious attribute usage to tell it what level you are coming from, and keep track of it.
Usually Game Over means if you want to play again, you are going to start from the beginning. I think what you are trying is a level fail?
My Skype Username is the same as my GS username.
How long have you been using GS for?
ozboy- Alright, I'll add you and I have been using GS for about a week and a half. I'm a noob, I know lol
Basically in the button to start the scene over you would use change attributes and load attributes to get everything reset back to where it was when you originally started the level. If you are just starting out, you really should watch all the videos from the Cookbook, and other helper sites for GameSalad. The most important thing is to get an idea of the basic functions, and to really learn what attributes are what, and how they work. They are your best friend, and you will be using them a lot, so you really should get as familiar with them as you can early on.
http://www.youtube.com/user/GameSaladCookbook
http://gshelper.com/
http://gleesongroupmedia.com/gsguide/gsguide.html
But I can't quite figure it out either. Anyone know? You guys are great, thank you!
I have scads of experience with other gameMakingPlatforms and some with GS … and, I still watch every video I can … and did the Cookbook when it became available.
gameAttributes are always active
scene and actorInstance attributes only become active when the scene loads and runs
therefore: a scene resets when the player leaves it (though if gameAttributes have changed … those changes can be applied when a scene loads)
exception: Pause Game does not reset scene unless player can changeScene there
@};- MH
and all the attributes are as defined in the scene layout you did at first … not what has happened in while that scene has run
But, changes to the gameAttributes that happened when that scene was running do not go back to their originals
gameAttributes are always active at all times … when your game is running
Sometime it is best to make sceneAttributes … if player can do a reset of the scene … EX: Score
and on your changeScene button:
Rule: when
Event: touch is pressed
--changeAttribute: game.Score To: game.Score+scene.Score
--changeScene
gameAttributes: store conditions for whole game
sceneAttributes: store conditions only for that scene
actorAttributes: store conditions only for that actor
@};- MH