Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Silence Before Playing Music
- YaBoi_Kenny
-
Scratcher
50 posts
Silence Before Playing Music
So I'm making a Dig Dug Remix and I added a repetitive beeping sound effect when idle (not moving), like when Pac-Man stops eat pellets or the sound of crickets. When Dig Dug walks he makes a short tune/jingle. Every time Dig Dug stops walking it automatically plays the sound. But that means every little stop it starts the sound.
What I want is that whenever he stops there's a silence for a second before that idle sound plays, and if there is an input it'll interrupt the silence with the jingle.
What I want is that whenever he stops there's a silence for a second before that idle sound plays, and if there is an input it'll interrupt the silence with the jingle.
forever
if <<not <<<key [ Up] pressed?> or <key [ Down] pressed?>> or <<key [ Left] pressed?> or <key [ Right] pressed?>>>>> then
wait (1) secs
forever
if <<not <<<key [ Up] pressed?> or <key [ Down] pressed?>> or <<key [ Left] pressed?> or <key [ Right] pressed?>>>>> then
stop all sounds
play sound [ v] until done
end
end
end
end
- zeldafan333
-
Scratcher
100+ posts
Silence Before Playing Music
I'm not sure, I'm not experiencing the issue. Maybe remove the wait 1 sec block?
- CatClawz_
-
Scratcher
500+ posts
Silence Before Playing Music
Try looking at the sound, sometimes there'll be silence at the start
- YaBoi_Kenny
-
Scratcher
50 posts
Silence Before Playing Music
Actually, I figured it out myself now. 

when green flag clicked
forever
if <not <key [ v] pressed?>> then
stop all sounds
wait (1) secs
repeat until <key [ v] pressed?>
play sound [ v] until done
end
end
end
- Discussion Forums
- » Help with Scripts
-
» Silence Before Playing Music