Reset a scene without stopping music...

sebmacflysebmacfly Member Posts: 1,018
edited November -1 in Working with GS (Mac)
Hi!

Bad issue here... Sometimes, the player have to reset the scene in my game..
The problem is that the music stops when reset.
How can i reset the scene without stopping the music? any way?

Thanks you

Comments

  • DrGlickertDrGlickert Member Posts: 1,135
    I believe I saw a post a few weeks ago saying that you cannot.

    "Reset Scene" behavior is not that good (just FYI). Try and do it some other way.
  • sebmacflysebmacfly Member Posts: 1,018
    The problem is that i have a lot of blocks in the scene... that blocks can be moved when playing. But if the player want to restart the level, i have to put these blocks in their origin place.
  • DrGlickertDrGlickert Member Posts: 1,135
    Reseting the scene will put the blocks back where they started during the scene. However, all attributes that have been changed during gameplay will not be reset to what they started at. On my "reset scene" button I have a rule;
    When touch is pressed & inside;
    Change Attributes (back to what the level started at)
    &
    Reset Scene
  • sebmacflysebmacfly Member Posts: 1,018
    Thanks mate...

    My idea is to make 2 actor attributes (for the blocks)
    -xOrigin
    -yOrigin

    when i start the scene i'll change attribute xOrigin to self.position.X and yOrigin to self.position.Y
    If i need to replace the blocks i'll change the self positions to that two actor attributes.

    Sounds good?
  • sebmacflysebmacfly Member Posts: 1,018
    Thanks for support guys
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Doing an instant reset using the method in TSB's video is going to be the best way to reset the scene without reseting the music.

    @DrGlickert. I have mentioned this before when I saw you post a rule like that. Touch is pressed and inside is not needed. touch is pressed is all you need

    touch is inside means you can swipe over the actor or touch down on the actor to active the rule. if you have touch is pressed & inside the pressed condition negates anything the inside adds. Your adding un needed conditions to your rules.

    I'm not harping on you or anything I just think others need to know its unnecessary so they are not adding these same extra conditions.

    ___________________________________________________________________________________
    TEMPLATES AND PROJECT HELP BY TENRDRMER. CLICK HERE!!!

    AppSolute Entertainment on Facebook
    AppSolute Entertainment on iTunes
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    sebmacfly said:
    Thanks mate...

    My idea is to make 2 actor attributes (for the blocks)
    -xOrigin
    -yOrigin

    when i start the scene i'll change attribute xOrigin to self.position.X and yOrigin to self.position.Y
    If i need to replace the blocks i'll change the self positions to that two actor attributes.

    Sounds good?

    Yep that is the basis of instant reseting. Make sure you are not destroying anything though. Instead of a destroy change the x and y to an off screen position.

    ___________________________________________________________________________________
    TEMPLATES AND PROJECT HELP BY TENRDRMER. CLICK HERE!!!

    AppSolute Entertainment on Facebook
    AppSolute Entertainment on iTunes
  • bluebyu25bluebyu25 Member Posts: 500
    Just to make sure I understand this right as well, resetting a scene DOES NOT reset changed attributes that have taken place within the scene, correct? I kind of skimmed over most of the posts here but wanted to make sure.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    bluebyu25 said:
    Just to make sure I understand this right as well, resetting a scene DOES NOT reset changed attributes that have taken place within the scene, correct? I kind of skimmed over most of the posts here but wanted to make sure.

    Yeah in the button to reset the scene you also need to change all attributes back to how they where when the scene started.
  • SkyMapleSkyMaple Member Posts: 817
    Can anyone point me towards the instant reset video? I must have missed that one.

    Thanks!
  • kapserkapser Member Posts: 458
    Wow I didn't know that, hardest part sounds like it will be the destroyed actors. Need a controller object to respawn them only if they were destroyed, etc.

    I guess changing scene stop music too, that might be iconvenient.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    kapser said:
    Wow I didn't know that, hardest part sounds like it will be the destroyed actors. Need a controller object to respawn them only if they were destroyed, etc.

    I guess changing scene stop music too, that might be iconvenient.

    No the point of instant reset is for game performance. if you are destroying and respawning actors you will still kill your performance in a new way.

    Instead of using destroy to use two change attributes to change the x and y positions of the actor to a position off the screen. and then when the reset button is pressed you will change a game attribute to true for the reset and have all of your actors x and y's change back to their starting point when the reset is true.
  • StuartYStuartY Member Posts: 134
    Yep, follow TSB's video and tenrdrmer's advice! I set up a reset system recently, and although it's a bit of a faff it's A) not as hard as you might imagine B) makes the game SO much smoother and more responsive for the end user. Your game will go from needing to load every time the player fails to doing it near instantly if you do it right. One thing that TSB's video doesn't mention is that you also might want to reset the angle of your blocks as well as the position. And don't forget to set the motion to 0.

    This is the video you're after;

Sign In or Register to comment.