This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-11-29 01:07:41

theapproom
Scratcher
Registered: 2009-08-24
Posts: 38

NEED HELP on restarting a scratch project?

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

 

#2 2009-11-29 01:14:54

what-the
Scratcher
Registered: 2009-10-04
Posts: 1000+

Re: NEED HELP on restarting a scratch project?

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)


http://imageshack.us/m/64/9034/ddfss.pngMy site
Find someone post count. Click posts under username. Find number of pages. Times that by 40 for min and 60 for max and you have a rough estimate of post count.

Offline

 

#3 2009-11-29 01:18:15

theapproom
Scratcher
Registered: 2009-08-24
Posts: 38

Re: NEED HELP on restarting a scratch project?

Okay thank you, it worked  smile

Offline

 

#4 2009-12-23 09:32:21

greatpopcorn
Scratcher
Registered: 2008-10-04
Posts: 19

Re: NEED HELP on restarting a scratch project?

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.


Signature yet to be approved.

Offline

 

#5 2009-12-23 14:07:16

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: NEED HELP on restarting a scratch project?

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.


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#6 2009-12-23 14:22:32

cocoanut
Scratcher
Registered: 2007-07-10
Posts: 1000+

Re: NEED HELP on restarting a scratch project?

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!


http://i42.tinypic.com/20gyvif.jpgPlease leave a message at the beep.
Steam: Hellephant

Offline

 

#7 2009-12-29 13:02:50

songhead95
Scratcher
Registered: 2008-03-19
Posts: 100+

Re: NEED HELP on restarting a scratch project?

<when[Restart]clicked>
<broadcast[scratch-startclicked]>

this will send a message to click the green flag

Offline

 

Board footer