Reset scene without stopping music?

micahmicah Member Posts: 85
edited November -1 in Working with GS (Mac)
Is it possible to reset the scene without stopping the music? In my game when you die it just resets the scene, but I don't want to start the music over from the beginning each time. Is this possible?

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    you can't use reset scene. unfortunately it will kill the bg music. i wish they would fix it.

    what you have to do is this:

    keep a global integer attribute called currentLevel.

    Instead of reset scene, use a rule and change scene like this:

    When game.currentLevel = 1
    Change Scene to Level 1

    When game.currentLevel = 2
    Change Scene to Level 2

    etc...

    It's tedious, but it works.

    Hope this helps!
    Joe
  • micahmicah Member Posts: 85
    Awesome, this works great! Thanks.
  • ckck Member Posts: 224
    To add to this, to start music on my splash screen and keep it playing everywhere in the game, I created a global integer attribute called playMusic defaulting to a value of 0, then had the splash screen background actor spawn an invisible actor that said "if playMusic = 0, erm, play music".

    On both scene navigation buttons on the splash screen, I set playMusic to 1. And, as FMG says above, instead of setting up Reset Scene on the main playing screen, I said "if playMusic = 1" Change Scene to main playing scene.

    This way, the music starts when the app starts, and doesn't stop or restart until the app is quit. So far...

    kx
Sign In or Register to comment.