Scene switch

myu699myu699 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

  • OscarsCodingOscarsCoding Member Posts: 92

    Just drag in the Reset Scene behavior, it can't get much easier than that :)

  • myu699myu699 Member Posts: 96
    edited April 2015

    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.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2015

    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:

    1. Intro
    2. Menu
    3. Level 1
    4. Level 2
    5. Level 3
    6. Replay

    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

  • myu699myu699 Member Posts: 96

    Oh ok thanks! @tatiang @OscarsCoding

Sign In or Register to comment.