Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Making a successful restart for my game
- MarioBoyN8
-
11 posts
Making a successful restart for my game
I need to figure out a way to make my game restart when the frog hits the water however when I tested my restart page if I clicked away from the button the game would continue playing if anyone could test this and help me fix this would be very appreciated thanks 
Sorry I forgot to link my project
So here it is
https://scratch-mit-edu.ezproxyberklee.flo.org/projects/1076575562

Sorry I forgot to link my project
So here it is
https://scratch-mit-edu.ezproxyberklee.flo.org/projects/1076575562
Last edited by MarioBoyN8 (Feb. 19, 2025 19:38:52)
- jmb1293634
-
100+ posts
Making a successful restart for my game
please can you link the project but in the mean time this might work:
in frog:
in frog:
when I receive [restart v]in restart button:
wait until <touching [water v] ?>
broadcast [game over v]
when I receive [restart v]and replace all the game scripts hats with:
hide
when green flag clicked
broadcast [restart v]
when I receive [game over v]
show
wait until <<mouse down?> and <touching [mouse pointer v] ?>>
broadcast [restart v]
when I receive [restart v]
- 10goto10
-
500+ posts
Making a successful restart for my game
Your project does seem to restart so I think you might be asking specifically
If you’re wondering why it restarts when you click anywhere on the screen, your Sprite4, the one with the Retry costume is only checking for
So that’s going to be true even when the mouse is not touching the sprite.
Looks like you want to instead test for this in your Sprite4 script.
… when I tested my restart page if I clicked away from the button the game would continue playing
If you’re wondering why it restarts when you click anywhere on the screen, your Sprite4, the one with the Retry costume is only checking for
<mouse down?>
So that’s going to be true even when the mouse is not touching the sprite.
Looks like you want to instead test for this in your Sprite4 script.
<<mouse down?> and <touching [mouse-pointer v] ?>>
- Discussion Forums
- » Help with Scripts
-
» Making a successful restart for my game