Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » I need help with making the game over screen becouse of sound.
- Sekomek
-
Scratcher
6 posts
I need help with making the game over screen becouse of sound.
I have a game where every clone of a sprite can trigger a game over screen. But the problem is every time a sprite touches the edge in my game a 5 second sound plays. I want to make it that it play only once but i want to keep the visual of the game. For some reason the enemies aren't stopping. My code is a MESS so even I cannot figure this out. Can someone help me? (I even made a 2 phase game over action that dosen't work)
Last edited by Sekomek (Jan. 6, 2023 20:04:20)
- josh500311
-
Scratcher
64 posts
I need help with making the game over screen becouse of sound.
I have a game where every clone of a sprite can trigger a game over screen. But the problem is every time a sprite touches the edge in my game a 5 second sound plays. I want to make it that it play only once but i want to keep the visual of the game. For some reason the enemies aren't stopping. My code is a MESS so even I cannot figure this out. Can someone help me? (I even made a 2 phase game over action that dosen't work)
you didn't link your game
- mmhmBeans
-
Scratcher
500+ posts
I need help with making the game over screen becouse of sound.
Not very optimal, but you can make a “playing” variable and stop the clones from broadcasting game over like this.
In the sprite that plays the sound, put this.
. . .
if <(<touching [edge v]> + (PLAYING)) = (2)> then
broadcast [skill issue v]
set [PLAYING v] to (0)
end
. . .
In the sprite that plays the sound, put this.
when I receive [skill issue v]
play sound [game over v] :: sound
. . .
- Sekomek
-
Scratcher
6 posts
I need help with making the game over screen becouse of sound.
I have a game where every clone of a sprite can trigger a game over screen. But the problem is every time a sprite touches the edge in my game a 5 second sound plays. I want to make it that it play only once but i want to keep the visual of the game. For some reason the enemies aren't stopping. My code is a MESS so even I cannot figure this out. Can someone help me? (I even made a 2 phase game over action that dosen't work)
you didn't link your game
I have such a mess even I can clean it up, so i dont want to post my mess
- Sekomek
-
Scratcher
6 posts
I need help with making the game over screen becouse of sound.
Not very optimal, but you can make a “playing” variable and stop the clones from broadcasting game over like this.Thanks, it worked!. . .
if <(<touching [edge v]> + (PLAYING)) = (2)> then
broadcast [skill issue v]
set [PLAYING v] to (0)
end
. . .
In the sprite that plays the sound, put this.when I receive [skill issue v]
play sound [game over v] :: sound
. . .
- Discussion Forums
- » Help with Scripts
-
» I need help with making the game over screen becouse of sound.