How do I create a reset screen.

18jhanshew18jhanshew Member, PRO Posts: 5

I'm working on an "infinite runner" and was wondering how to make a screen appear after you die to reset the scene. The way I've tried doing it was having actors spawn when you die for a background and reset button, however I can't control we're they appear in relation to the camera. I've also tried making separate scenes for them but that would take a lot of scenes.

Once I've got the screen working, I'm also curious about how to make a random text box appear displaying one of several messages based on how you die (for example, about 10 phrases related to lava based death for when you fall in lava) and have no idea how to go about it.

Any suggestions?

Best Answer

  • tatiangtatiang Posts: 11,927
    Accepted Answer

    Yep, sorry, I meant that you should reset the scene after it's unpaused. So have the pause scene change a game attribute (e.g. boolean) and then have the gameplay scene reset when that attribute changes value.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,927

    Use the Pause Game behavior. It allows you to display a separate scene on top of the current scene.

    There are many tutorial videos available that cover pausing a scene and also that cover choosing a random value from a table. I would start with Google searches along the lines of gamesalad pause game and gamesalad choose random value.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • 18jhanshew18jhanshew Member, PRO Posts: 5

    @tatiang said:
    Use the Pause Game behavior. It allows you to display a separate scene on top of the current scene.

    There are many tutorial videos available that cover pausing a scene and also that cover choosing a random value from a table. I would start with Google searches along the lines of gamesalad pause game and gamesalad choose random value.

    I've tried using Pause Game, but once I hit the reset button it wont unpause and reset at the same time.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,927

    I don't know exactly how your gameplay scene is set up, but generally speaking you would have a button (actor) on the pause scene that does a Reset Scene behavior (or Change Scene if you want to go back to the menu scene, for example). So you're not using the Unpause Game behavior at all.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,914

    Spawn your actors on the hud layer for the reset.

  • owen_dennisowen_dennis Just a guy, you know. Member, PRO Posts: 236
    edited February 2016

    Oh interesting, I didn't realize that using a reset scene behavior in the pause screen would reset the the scene that's it's paused on top of. I mean that's what you'd want I think, I just didn't realize it. I thought this whole time you had to have the pause scene do a change scene back to your game if you wanted to reset it instead of just unpause it. I'll look into using that in a game I'm working on. Feels like I would be easier than having a separate rules inside every actor when there's a gameover.

  • mhedgesmhedges Raised on VCS Member Posts: 634

    Easy. Have change scene behavior invoked, preferably using a timer.

    Example:
    1. Have a Splash Scene in which upon pressing play you set the default values for the game and then Change Scene to Game Scene.
    2. In the Game Scene, upon character death, spawn a Game Over actor or Display Text "Game Over"
    3. Use a timer so that after 3 seconds, you change scenes back to the splash scene.

  • 18jhanshew18jhanshew Member, PRO Posts: 5

    @tatiang said:
    I don't know exactly how your gameplay scene is set up, but generally speaking you would have a button (actor) on the pause scene that does a Reset Scene behavior (or Change Scene if you want to go back to the menu scene, for example). So you're not using the Unpause Game behavior at all.

    I've tried that, but the Reset Scene only effects the current scene (in this case the pause menu) so it resets the pause menu and doesn't go back to the scene were you died (as I mentioned above I've considered using a separate reset scene for each level with the Change Scene button)

  • 18jhanshew18jhanshew Member, PRO Posts: 5

    @mhedges said:
    Easy. Have change scene behavior invoked, preferably using a timer.

    Example:
    1. Have a Splash Scene in which upon pressing play you set the default values for the game and then Change Scene to Game Scene.
    2. In the Game Scene, upon character death, spawn a Game Over actor or Display Text "Game Over"
    3. Use a timer so that after 3 seconds, you change scenes back to the splash scene.

    I don't think you understand my above description. I don't want a splash screen, I want a screen that changes after pressing a button, and I can spawn the "Game Over" text, I just want to be randomized (for example it could say "You died." or "Ouch" or "Don't touch the spikes"), the only example I can really think of is the Minecraft launch screen.

  • 18jhanshew18jhanshew Member, PRO Posts: 5

    @tatiang said:
    Yep, sorry, I meant that you should reset the scene after it's unpaused. So have the pause scene change a game attribute (e.g. boolean) and then have the gameplay scene reset when that attribute changes value.

    Thanks that seems to work.

Sign In or Register to comment.