Scene switch
myu699
Member Posts: 96
Hi guys, for my game I have 10 levels, and I have set it up so that when each level is passed it goes to a scene that asks if they want to repeat it. The problem is is that I want only one scene that when an actor is pressed it will go to the level they just did.
example
pass level 1:goes to scene replay
when replay button is pressed it goes to back to level 1
pass level 2 :goes to scene replay
when replay button is pressed it goes back to level 2
Comments
Just drag in the Reset Scene behavior, it can't get much easier than that
Sorry for the confusion, what I meant is that when it goes to the replay scene and I hit replay I want it to go to the scene it was at before.
Then you need to store the value of the level that is chosen on your menu scene. So when the player starts a level, change game.level (integer) to the value for that level (e.g. 1, 2, 3, etc.). On your replay scene, Change Scene using index game.level.
Depending on how you've ordered your scenes, you may need an offset value. For example, if your scenes are:
Then Level 1 is actually scene #3. So you'd Change Scene index game.level+2.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Oh ok thanks! @tatiang @OscarsCoding