Making music stop


#1

How do you make music stop after starting it when creating a game?


#2

repeat forever
. . check once if ((stopping value)=0)
. . . . moosics
. .

and

when (stopping trigger)
set value (stopping value) to 1


#3

There should be a stop all sounds block, like scratch.


#4

There doesn't need to be a stop all sounds block though, because you can code it with a value and a text object.


#5

The problem with not having some blocks, is that it makes more code. The more you have to add code that could be just put into a block, the more the app works, and if the app works to hard, it quits.


#6

Well, the Hopscotch Team would have to code the stop all sounds block anyways, making the same amount of code.


#7

https://drive.google.com/file/d/0B9X8sQoiJN7GVF81UURRZ0VvUVU/view?usp=sharing

Imagine adding that music by upload. Then having a block to stop it when the game is finished. Saves time, and lag.


#8

That'd be cool to be able to upload music :wink:. To stop it all you have to do is

Repeat Forever
  Check once if Music=1
  Play Music

Once the game is finished the value Music would be set to one.


#9

That wouldn't work. Once the game ends, you have to wait for the song to be over. I agree, we need a stop sounds block.


#10

If you put a Check Once if for every sound block it would work.


#11

True. But for longer songs, with over 64 notes, the Check Once If blocks stop working, which is a problem fe regular coding as well.


#12

There are a lot of blocks that need to be added. Basically, we need to have these me blocks as scratch except the broadcasting message thing. We can use variables for that.


#13

Hi, I’m also one of those ppl who were wondering how to stop noises on hopscotch when a certain object is pressed or something like that. I was scrolling thru feed related to this topic when I saw a post from @DragonLover975 who said there’s a way to code it. (method above) However, as I’m sorta a noob, I don’t fully understand it. Any ideas on what he/she meant?