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

#1 2007-12-23 01:41:50

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Click green flag to restart?

I always thought  that clicking the green flag would restart the scratch program but I've seen a few projects where it doesn't work or you need to click it several times to restart.

My project "scratch smash" will not restart when the green flag is clicked.

http://scratch.mit.edu/projects/archmage/71543

Just try jumping off the edge until you lose all your lives and then the green flag won't restart the program.

Last edited by archmage (2007-12-23 01:45:30)


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#2 2007-12-23 02:17:25

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Click green flag to restart?

I think what is happening here is that you have set up a condition from which the program can not recover.  At the end of the game, one of the players will have

lives < 1

Then, you have set up a condition

[blocks]
<when green flag clicked>
<wait until> <( lives <<> 1 )>
<stop all>
[/blocks]

Which may be executing before lives is ever reset so that the program is immediately doing a stop every time the green flag is clicked.

Last edited by Paddle2See (2007-12-23 02:18:38)


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#3 2007-12-23 09:26:54

MyRedNeptune
Community Moderator
Registered: 2007-05-07
Posts: 1000+

Re: Click green flag to restart?

"Green flag clicked" is just a condition, such as "when (blah) clicked" or "when key (blah) pressed".

Last edited by MyRedNeptune (2007-12-23 09:27:28)


http://i52.tinypic.com/5es7t0.png I know what you're thinking! "Neptune! Get rid of those filthy advertisements and give us back the Zarathustra siggy, you horrible person!" Well, don't worry about it, the Zara siggy will be back soon, new and improved! ^^ Meanwhile, just do what the sig tells you to. >.>

Offline

 

#4 2007-12-23 09:41:24

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: Click green flag to restart?

Yes. The green flag only starts the scripts with the "When green flag clicked" hat. If you want it to restart your project, you have to reset the variables yourself in a "startup" script. You can do the same with X and Y positions of sprites, volume, tempo, ... everything what chages in your project. Prehaps it would be good to have a restart button in the online player to.


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#5 2008-01-07 07:04:30

sphinx562
Scratcher
Registered: 2008-01-07
Posts: 2

Re: Click green flag to restart?

When you put something under the green flag, it starts something like the game or the animation or whatever.

Offline

 

Board footer