I need help on restarting a project of mine, by clicking a sprite called restart. I need it to be when you click restart the green flag turns green, how do I do this?
Offline
You can't force the green flag to start but how about this.
<when[ restart ]clicked>
<set{ All variables }to( defult ) >
<broadcast[ restart ] >
Now for all of the other scripts. Get rid of that green flag thing. You don't need it and replace it with this
<when I receive[ restart ] >
Do what ever
Just tell people to click on the restart object when they first play the game. maybe give it a different costum
<when green flag clicked>
<switch to costume[ Click here to start ]
<wait until> << <mouse down?> <and> <touching[ mouse pointer ] >>
<switch to costume[ restart ] >
Last edited by what-the (2009-11-29 01:21:47)
My site Offline
Okay thank you, it worked
Offline
Actually, you can restart a program without replacing all the green flag blocks. Just simply, when you want it to restart, have it broadcast Scratch-StartClicked. It will start all the green flag scripts like you had clicked the green flag.
Offline
what-the wrote:
You can't force the green flag to start but how about this.
<when[ restart ]clicked>
<set{ All variables }to( defult ) >
<broadcast[ restart ] >
Now for all of the other scripts. Get rid of that green flag thing. You don't need it and replace it with this
<when I receive[ restart ] >
Do what ever
Just tell people to click on the restart object when they first play the game. maybe give it a different costum
<when green flag clicked>
<switch to costume[ Click here to start ]
<wait until> << <mouse down?> <and> <touching[ mouse pointer ] >>
<switch to costume[ restart ] >
If you put a "broadcast restart" on a block that said "when I receive restart", you'll end up with variables stuck forever.
Offline
greatpopcorn wrote:
Actually, you can restart a program without replacing all the green flag blocks. Just simply, when you want it to restart, have it broadcast Scratch-StartClicked. It will start all the green flag scripts like you had clicked the green flag.
Wow, that works! I never knew about that! Thanks!
Please leave a message at the beep.Offline
<when[Restart]clicked>
<broadcast[scratch-startclicked]>
this will send a message to click the green flag
Offline