replay last played level

matthowarthmatthowarth Member Posts: 76
edited November -1 in Working with GS (Mac)
ok, this one has me scratching my head.

How do you make a button that tells the game to play the last level you have just played, regardless of what level it is.

I know I could have a "play again" level specifically after each level and then the button would just be "change scene > previous level", but that seems like a very cumbersome way to do it.

Anyone got a more elegant way?

cheers

Matt

Comments

  • DrGlickertDrGlickert Member Posts: 1,135
    First thing that comes to mind is "Reset Scene" behavior. However, keep in mind that this literally will reset the scene, nothing saves.

    So if you're on level 5, if you click on Reset Scene it will reset level 5. If you're on level 12, it will reset level 12.

    Does that help?
  • matthowarthmatthowarth Member Posts: 76
    hi

    thanks for responding. The problem is that I want to go to a separate scene which knows which scene you have just played - I think I can do that bit by having a behavior at the end of each scene which alters a scene attribute to match the scene number. My problem arises when it comes to the change scene behavior, its choices are limited to previous, next or named scenes.

    Angry Birds has this type of system where, at the end of a level that you've failed, you have a screen that says "level failed" and you have numerous options to either play again, go back to the main menu, play next scene (if it's unlocked).

    I suppose I could do it all within the same scene where the graphic appears as an actor in front of everything else, that way "reset scene" could work.

    Anyone else got any thoughts?

    thanks again
  • eccentrismeccentrism Member Posts: 4
    Well I'm pretty new to GameSalad but I think you could have an attribute called lastlevel (for example) that would be updated with the level number each time they enter a new level. So if they start playing level 3, you could make lastlevel = 3. Then when they hit the "Play Last Level" button that would reference lastlevel.

    Now I'm going on a limb and on foggy memory of how it works. But have a behavior that says (more or less) if "Play Last Level" is pressed and lastlevel = 3 go to named scene "Level 3"... I'm really paraphrasing and guessing here but maybe that would work :)
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Just a previous scene behavior would be the easiest to setup. Why would not want that. If you set up rules to load each individual level based on an attribute you will literally have a button that you have to put in as many rules as you have levels. why do that when you can have a button with one touch is press change scene to previous scene rule?
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    matthowarth said:
    Angry Birds has this type of system where, at the end of a level that you've failed, you have a screen that says "level failed" and you have numerous options to either play again, go back to the main menu, play next scene (if it's unlocked).

    I suppose I could do it all within the same scene where the graphic appears as an actor in front of everything else, that way "reset scene" could work.

    And yeah that all angry birds system is. A menu slides in from off camera and now you have those options. You can simply have them spawn at the end of the level or you can place them in the scene and do change attributes to move it inplace
  • matthowarthmatthowarth Member Posts: 76
    thanks all,

    I'll give the "spawning an actor graphic with buttons" method and use reset scene - a la angry birds.

    cheers

    Matt
Sign In or Register to comment.