Discuss Scratch

Willwizard119
Scratcher
73 posts

Help with switching music

In a game I'm working on, I'm wanting the music to change from the level theme to the boss theme as soon as the boss starts. Any tips on how to do this?
Lifeoftheparty29
Scratcher
17 posts

Help with switching music

Have a sprite that plays the music. Make a broadcast for when the boss enters. When the sprite receives this broadcast, have it change the music.

when I receive [Post End v]
say (Signature)
danielhal
Scratcher
100+ posts

Help with switching music

You could have a variable called music which starts off set to 0 and then gets set to 1 once the boss fight starts. Then make a script to go with it like this:
when green flag clicked
repeat until <[music] = [1]>
play sound [normal music v] until done
end
play sound [bossfight music v]
footsocktoe
Scratcher
1000+ posts

Help with switching music

Willwizard119 wrote:

In a game I'm working on, I'm wanting the music to change from the level theme to the boss theme as soon as the boss starts. Any tips on how to do this?

If it has to start as soon as the boss starts, then do this

when I receive [boss starts v]
stop all sounds
play sound [boss theme v]


SHOOT THE SPACE MONSTERS! ….. A game everyone can play! Bright colors, bonky sounds!
THE 12 BALLS OF CRAZY AL ……. New scrolling adventure game!

Willwizard119
Scratcher
73 posts

Help with switching music

Thanks for the tips!
Willwizard119
Scratcher
73 posts

Help with switching music

Ummm. can somebody tell me what I'm doing wrong?

https://scratch.mit.edu/projects/169517253/#editor
footsocktoe
Scratcher
1000+ posts

Help with switching music

Willwizard119 wrote:

Ummm. can somebody tell me what I'm doing wrong?

https://scratch.mit.edu/projects/169517253/#editor

Not shared.


SHOOT THE SPACE MONSTERS! ….. A game everyone can play! Bright colors, bonky sounds!
THE 12 BALLS OF CRAZY AL ……. New scrolling adventure game!

Willwizard119
Scratcher
73 posts

Help with switching music

I… don't really understand.
footsocktoe
Scratcher
1000+ posts

Help with switching music

Willwizard119 wrote:

I… don't really understand.

You gave a link to your project but you forgot to share your project. We can't see it until you share it.


SHOOT THE SPACE MONSTERS! ….. A game everyone can play! Bright colors, bonky sounds!
THE 12 BALLS OF CRAZY AL ……. New scrolling adventure game!

Willwizard119
Scratcher
73 posts

Help with switching music

Oh. That makes sense.
Willwizard119
Scratcher
73 posts

Help with switching music

asivi
Scratcher
1000+ posts

Help with switching music

Willwizard119 wrote:

Will this work?
https://scratch.mit.edu/projects/169522837/

If it sorks for you, yes, it will work.
xdhoomy12x
Scratcher
51 posts

Help with switching music

this so easy why you ask

xdhoomy12x
when green flag clicked
go to [cursor]
Willwizard119
Scratcher
73 posts

Help with switching music

Hmmm. it doesn't work for me.
mstone326
Scratcher
1000+ posts

Help with switching music

How about using clones to control the music. Create a clone and have it play the first song, then when the boss battle starts, delete that clone, which will stop that music immediately, create a new clone and play the new song. FYI, I took out the detection from getting hit so you can go through all the stages to the boss battle to test the sound.

https://scratch.mit.edu/projects/169554619/

Last edited by mstone326 (July 23, 2017 15:18:42)


High School Athletic Director / Middle School Tech Teacher / High School Baseball Coach
Kung Fu by Nintendo 1984 - https://scratch.mit.edu/projects/369994801/
Taco Defense - Speed Typing - https://scratch.mit.edu/projects/316795450/
Halloween Boss Battle - Taking Back our Woods - https://scratch.mit.edu/projects/257155118/
Almost Pong - https://scratch.mit.edu/projects/656276979/
Studio - My Best Projects - https://scratch.mit.edu/studios/4125978/
Forum Help Project Examples - https://scratch.mit.edu/studios/4133335
danielhal
Scratcher
100+ posts

Help with switching music

I think it will work with what you have set up it's just the song has to finish before the music can change. To fix this, try adding
when backdrop switches to [backdrop6 v]
stop all sounds
so that the music is stopped immediately when the backdrop switches
Willwizard119
Scratcher
73 posts

Help with switching music

Thanks for the tips, everyone!

Powered by DjangoBB