Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Sound doesn't play!
- cwkmax6663
- Scratcher
24 posts
Sound doesn't play!
In my game, if one sprite touches another, the game will be over, so I decided to put in a game over sound effect and some text. However, when I have the sprites touch each other, the game over sound doesn't play.
Here is my script:
Here is my script:
when green flag clicked
show
play sound [ v] until done
Last edited by cwkmax6663 (Nov. 6, 2016 05:33:24)
- CobramCat
- Scratcher
68 posts
Sound doesn't play!
The first thing that I see is that you have set the sound to operate only at the initialising of the game.
Secondly “Show” is for graphics.
Assuming that you have two sprites of the colors in the script below, then when they touch the sound trigger is activated.
Does that make sense? A more experienced Scratcher may find some better explanation.
Secondly “Show” is for graphics.
Assuming that you have two sprites of the colors in the script below, then when they touch the sound trigger is activated.
if <color [#11dedd] is touching [#975a8d] ?> then
play sound [tune v] until done
end
Does that make sense? A more experienced Scratcher may find some better explanation.
create clone of [myself v]Sprites are easy, Clones are tidy, the KISS principle; but why is it not?
- ProfessorNatquik
- Scratcher
27 posts
Sound doesn't play!
Put a forever loop around the if statement.
Like that, but with your collision detecting blocks.
Basically, it is ALWAYS detecting if something is happening. Just put that code under your green flag bit.
forever
if <> then
end
end
Like that, but with your collision detecting blocks.
Basically, it is ALWAYS detecting if something is happening. Just put that code under your green flag bit.
- Discussion Forums
- » Help with Scripts
- » Sound doesn't play!