Getting music to play thru entire game?

TyvanTyvan Member Posts: 29
edited November -1 in Working with GS (Mac)
After each level aka scene , the best I can do is get the music to restart over again.

I read a post that said instead of go to x scene make it change to x scene. This did not work for me.

So how can I get music (one track looped) to play during the entire game no matter what happens in each scene or how many scene changes there are?

Thanks guys!

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    I think you're probably using 'reset scene' or 'reset game'.

    If you don't use these, then you can start a music track playing on your splash screen (the 1st screen with your logo on). Then, never go back to that scene (at the end of the game, go to the menu screen instead, for example).

    This way, your music will start and play continuously no matter what you do.

    Unless, as I mentioned, you reset the game or scene.

    Hope that helps,

    QS :D

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

  • ChaserChaser Member Posts: 1,453
    Try game attribute music at 0 then player must press button to turn music on or 1
    Then have in that same button if game music equal to 1 play music loop. It use to work for me
  • TyvanTyvan Member Posts: 29
    Thanks for the info guys.

    My game will have to reset a scene many times. So I need a way to continuously play a track even if the scene gets reset or changed.

    Sorry I should have stated that in my first post.
  • A3MGA3MG Member Posts: 152
    Music still plays if you use change scene. Music stops if you use reset scene.

    So anytime you need to restart a level or same scene, use change scene instead of reset if you want to have the music keep playing.
  • JamesZeppelinJamesZeppelin Member Posts: 1,927
    I think one element is missing

    The next scene needs "play music" and select continue current music

    All scenes need something to tell it to play music even if it is the same song without a break

    ... I think... that is what i do anyways
  • ChaserChaser Member Posts: 1,453
    If you are resetting scene I'm doing this in my current game
    Global music attribute attached to a music on button but also another global attribute I call music was on. So when I touch the music on button it sets "music to 1 and also sets music was on to 1"
    Then on each scene I place a blank actor off screen that says this if music is 1 play music
    New rule if global attribute music was on is 1 then change attribute music on to 1

    The down side is that music starts over
    My music off button just sets music and music was on to 0
    I do this because when my actor dies I have it stop the current music and play the death scream/melody
  • TyvanTyvan Member Posts: 29
    I removed my reset scene and put in a change scene instead. I have a "resume current music" behavior on the scene. My music still starts over. What now?
  • TyvanTyvan Member Posts: 29
    OK I think I got it now. Thanks.
Sign In or Register to comment.