Read the following, since the actual question is a bit more complex than the topic title
I am making a Kingdom Hearts game, and I need the music to change after each level.
I am currently using this sort of script:
when I receive [Level 1] play sound [Level 1 Music] until doneand then
when I receive [Level 2] stop all sounds play sound [Level 2 Music] until doneAnd so on. But with that, if the player spends ages on Level 1, the music would just end since I have not scripted it to loop. So I tried this:
when I receive [Level 1] set [music] to [level 1]and then
when gf clicked repeat until < (music) = [Level 2] > play sound [Level 1 Music] until done endBut that doesn't work. I also tried substituting the 'play sound ___ until done' for just 'play sound ___' but that didn't work either.
Offline
Your second idea should work. Are you maybe missing a "set music to level 2" before the stop all sounds?
Offline
Here is a script I use for my personal music projects not online.
when [sprite 1 v] clicked stop all sounds set [music v] to [0] forever play sound [sound v] until done if <not<(music) = [0]>> stop script endFor a level, just swap out the when sprite clicked for when I recieve. It works because the stop all sounds will stop the sound, and automatically go to the next part of the script, yours might even work if you use the stop sounds block. But the current script you have will play the music, regardless of variable change, until it's done, then check for change.
Last edited by sonicfan12p (2012-06-05 14:49:00)
Offline
Your Welcome!
Offline