background music playing while changing scene?
Hi everybody,
quick question: how do I keep the background music playing while changing scenes in a game? Is it possible to do it or should I make my game with a unique scene?
As an example, I've seen that Zombie Drop game has background music playing without interruptions while changing game levels and I would like to have the same thing into my game.
thanks!
quick question: how do I keep the background music playing while changing scenes in a game? Is it possible to do it or should I make my game with a unique scene?
As an example, I've seen that Zombie Drop game has background music playing without interruptions while changing game levels and I would like to have the same thing into my game.
thanks!
Best Answers
-
stackpoole Melbourne, Victoria, AustraliaPosts: 473
Hi
It should keep playing, if it is already playing,
unless there is a rule you made to stop itSydney Swans 2014!!
-
921creative Posts: 140
Any time you have a "Play Music" behavior called out in a rule, the music will start from the beginning. The only way to not have the music start again is to remove the behavior from Scene 2. Problem is, when you go back to Scene 1, the music will start from the beginning again because you have the behavior called out in Scene 1. You need a game attribute that checks whether music is playing ("true"), and if it is false, Play Music, then set the attribute to true.
Answers
Also, do you have a Play Music behavior on Scene2?
Follow Eating My Hat on Facebook, Twitter and our Blog
Check out my templates in the GS Marketplace or at the store
And where should I put that game.Attribute that checks whether music is playing or not? I have now a Music Actor that has a Play Music behavior in Scene 1 only, and a boolean game Attribute called MusicPlaying (which is false)...
When Attribute "game.MusicPlaying" = false
[ Play Music ]
Change Attribute game.MusicPlaying to true
That way the music will continue playing as you go from scene to scene and will only start from the beginning if the music is not already playing.
thanks 921, I appreciate your help