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

#1 2012-04-13 13:28:54

PhirripSyrrip
Scratcher
Registered: 2012-02-11
Posts: 100+

Pressing Green Flag twice

Sometimes, I need to press the green flag twice in order to completely reset everything. If I press it once, then sometimes some things don't get reset. For example, when I press the green flag, the background and variables might reset normally but all the sprites don't hide/show. Am I doing something wrong or is this just a problem with the software.

Thanks  tongue


http://i46.tinypic.com/ao03lk.png

Offline

 

#2 2012-04-13 20:55:32

ROSMan
Scratcher
Registered: 2011-04-29
Posts: 1000+

Re: Pressing Green Flag twice

you're doing nothing wrong. Scratch can act up if there are a lot of variables or data that need to be stored.

Last edited by ROSMan (2012-04-13 20:55:42)


GENERATION 33: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment

Offline

 

#3 2012-04-13 23:42:35

SOScratch
Scratcher
Registered: 2010-02-01
Posts: 100+

Re: Pressing Green Flag twice

Yeah.
It happens to me on some of my projects too and also to many other people.

It's just normal.


-SOScratch
Scratch On!

Offline

 

#4 2012-04-14 14:14:19

mythbusteranimator
Scratcher
Registered: 2012-02-28
Posts: 1000+

Re: Pressing Green Flag twice

It can happen to everyone. Most large games, if you look in the project notes, says "press gf twice to reset."h


http://www.foxtrot.com/comics/2012-04-01-fdb37077.gif
clicky

Offline

 

#5 2012-04-14 14:21:59

chipguy
Scratcher
Registered: 2009-09-09
Posts: 500+

Re: Pressing Green Flag twice

i really don't know why it happens. they'll probably fix it in 2.0.


http://scratch.mit.edu/static/projects/chipguy/2919121_sm.png by yours truly  big_smile

Offline

 

#6 2012-04-14 14:45:20

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Pressing Green Flag twice

Sometimes you need to add a wait 0 seconds to the top of stuff.

Offline

 

#7 2012-04-14 14:52:18

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

Re: Pressing Green Flag twice

It has to do with the timing of things.  You might think that everything that is set up to run when the Green Flag is clicked happens at the same time.  But that is not quite the case.  Most of our computers are still single-threaded and only do one calculation at a time - so some things happen before others, even if they are set up to the same trigger block. 

The cure is to make sure that things that rely on a variable being reset or a sprite being in the right place before they start checking have a Wait block before them, usually with no more than 0.5 seconds delay.  So if you have a Forever loop in one part of the code that is looking for a variable to get to a certain value...put a Wait block before it to give the variable time to be reset before it starts looking at it. And make sure the variable is initialized on Green Flag.


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

Offline

 

#8 2012-04-14 15:14:49

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Pressing Green Flag twice

Paddle2See wrote:

It has to do with the timing of things.  You might think that everything that is set up to run when the Green Flag is clicked happens at the same time.  But that is not quite the case.  Most of our computers are still single-threaded and only do one calculation at a time - so some things happen before others, even if they are set up to the same trigger block. 

The cure is to make sure that things that rely on a variable being reset or a sprite being in the right place before they start checking have a Wait block before them, usually with no more than 0.5 seconds delay.  So if you have a Forever loop in one part of the code that is looking for a variable to get to a certain value...put a Wait block before it to give the variable time to be reset before it starts looking at it. And make sure the variable is initialized on Green Flag.

This.  To fix it, I just do what Paddle2See just said, or just make any script that relies on a variable responsible for reseting it.  Glad that somebody isn't blaming Scratch  tongue

P.S. an advantage of 1s1s is that there is no randomness in the order of which scripts run first/faster  smile

Last edited by MoreGamesNow (2012-04-14 15:15:28)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

Board footer