Discuss Scratch

tbpatj
Scratcher
44 posts

Menu music

So I am trying to get my game so in the menu it plays some music I am using some off of scratch right now until I decide but I want it so that it keeps on playing that music during the tittle screen and all through out the menu and keep on playing until I choose story mode or a free play level here is my game Rocket Rescue can anybody help me with this I would really appreciate it

Last edited by tbpatj (June 6, 2013 16:37:12)

manwithmanykids
Scratcher
67 posts

Menu music

I think you could do the following

Create a Variable, MusicON.

In the back drop under the green flag, step it to on

Create a new event that listens for he broadcast Music

in the event create a forever loop and in the loop create and if then as Follows
Forever until MusicON = ‘OFF’
If MusicON = ‘ON’ then
PlayMusic until Done
end if
End Forever
Stop All Sounds


Now Just Change the Variable MusicOn to Off

Heres my Pokemon Battle Project

http://scratch.mit.edu/projects/10433760/

mwiedmann
Scratcher
100+ posts

Menu music


First create a global variable called “MusicState”.

When your menu launches, do a “broadcast menu_music_on”.
When your menu is closed, do a “broadcast menu_music_off”

On your Stage (or whatever Sprite has the music) have these 2 handlers:

When I receive menu_music_on
Set MusicState=1
Repeat until MusicState=0
play sound menu_music until done

When I receive menu_music_off
Set MusicState=0
stop all sounds

I think this will work.
manwithmanykids
Scratcher
67 posts

Menu music

Hmmm, lol

Heres my Pokemon Battle Project

http://scratch.mit.edu/projects/10433760/

dememes2001
Scratcher
4 posts

Menu music

manwithmanykids wrote:

I think you could do the following

Create a Variable, MusicON.

In the back drop under the green flag, step it to on

Create a new event that listens for he broadcast Music

in the event create a forever loop and in the loop create and if then as Follows
Forever until MusicON = ‘OFF’
If MusicON = ‘ON’ then
PlayMusic until Done
end if
End Forever
Stop All Sounds


Now Just Change the Variable MusicOn to Off
https://scratch.mit.edu/projects/327550106/editor
like this? click the sprite that is invisible.

Last edited by dememes2001 (Oct. 22, 2019 19:50:30)

Zizzle8383
Scratcher
100+ posts

Menu music

dememes2001 wrote:

manwithmanykids wrote:

I think you could do the following

Create a Variable, MusicON.

In the back drop under the green flag, step it to on

Create a new event that listens for he broadcast Music

in the event create a forever loop and in the loop create and if then as Follows
Forever until MusicON = ‘OFF’
If MusicON = ‘ON’ then
PlayMusic until Done
end if
End Forever
Stop All Sounds


Now Just Change the Variable MusicOn to Off
https://scratch.mit.edu/projects/327550106/editor
like this? click the sprite that is invisible.
DONT NECROPOST this is from 2013 dude

Last edited by Zizzle8383 (Oct. 22, 2019 20:54:16)


Hyperbowls will live on!

It's Selltick, PPA.
Floatiee798
New to Scratch
1 post

Menu music

Sorry i didn't know you couldn't delete comments

Last edited by Floatiee798 (May 3, 2020 16:22:13)

VerycooldudeIamepic
Scratcher
7 posts

Menu music

Floatiee798 wrote:

Sorry i didn't know you couldn't delete comments
14doodle
Scratcher
3 posts

Menu music

Try this for the mode selection
when this sprite clicked
stop all sounds
djcatboyayS
Scratcher
2 posts

Menu music

Thank you that worked

Last edited by djcatboyayS (Oct. 7, 2023 18:08:25)

ExtraMental
Scratcher
100+ posts

Menu music

Please do not necropost.

djcatboyayS wrote:

Thank you that worked

- Guy who talks and thinks like he is a wiki article (he is not).

I have over 100 posts now

If am not sleeping or doing something else I am watching the help with scripts discussion page
dkps67
Scratcher
3 posts

Menu music

dememes2001 wrote:

manwithmanykids wrote:

I think you could do the following

Create a Variable, MusicON.

In the back drop under the green flag, step it to on

Create a new event that listens for he broadcast Music

in the event create a forever loop and in the loop create and if then as Follows
Forever until MusicON = ‘OFF’
If MusicON = ‘ON’ then
PlayMusic until Done
end if
End Forever
Stop All Sounds


Now Just Change the Variable MusicOn to Off
https://scratch.mit.edu/projects/327550106/editor
like this? click the sprite that is invisible.

is the varible, musicON global or local?

Powered by DjangoBB