Discuss Scratch

MarioBoyN8
Scratcher
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

Last edited by MarioBoyN8 (Feb. 19, 2025 19:38:52)

jmb1293634
Scratcher
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:
when I receive [restart v]
wait until <touching [water v] ?>
broadcast [game over v]
in restart button:
when I receive [restart v]
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]
and replace all the game scripts hats with:
when I receive [restart v]
10goto10
Scratcher
500+ posts

Making a successful restart for my game

Your project does seem to restart so I think you might be asking specifically

MarioBoyN8 wrote:

… 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] ?>>

Powered by DjangoBB