Scene Reset

obsoleteentertainmentobsoleteentertainment Member, PRO Posts: 21
edited November -1 in Working with GS (Mac)
Hi there,

i have a hard time using the scene reset behavior. What is the best way to reset a scene when the level is done? I tried actors off screen, actors in the game, an actor which only appears when game.levelcomplete is true. No matter what i do, either its in a resetting loop or does nothing :(

I know that probably nobody can solve my problem without seeing my app but isnt there some kind of universal way to reset a scene on exit/next scene?

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    You can do a scene reset manually - I *never* use the behaviour if I'm honest.

    If you change scene at the end to the same scene, all actors within it would be reset to their original positions.

    It would then be a case of, when you touch the button that 'resets' your scene, changing any attributes that need changing. Score, for example, would be changed back to 0.

    A more complex method, but better for performance would be to give all your actors initial positions, storing those positions (X+Y) in self variables, then resetting these positions to their original ones when you press a 'reset' button.

    Hope that makes sense/helps!

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • obsoleteentertainmentobsoleteentertainment Member, PRO Posts: 21
    hi quantumsheep,

    "If you change scene at the end to the same scene, all actors within it would be reset to their original positions. "

    That, unfortunatly is not happening :( If i change the scene to the next level than change to the lvl menu an go back to the initial lvl, all actors which got destroyed aint there?

    Is the storing of the initial positition really better for performance? I do have about 15-30 actors. That'll be 60 attributes? Do attributes dont decrease performance?
  • obsoleteentertainmentobsoleteentertainment Member, PRO Posts: 21
    60 attributes per level btw...
Sign In or Register to comment.