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

#1 2011-11-24 08:49:11

musicomusico
New Scratcher
Registered: 2011-11-12
Posts: 1

Game over --refreshing variables?

Is there a way to send a command to refresh all variables & broadcasts?  Not sure what is happening, but my game will play once, but then try to go "Game Over" a couple seconds after restart  (or continue to keep giving the "100 points of life" on "flag click" making may character "invincible" rather than allowing him to be damaged).

Hope this make sense...If I click restart again, the problem goes away.

Thanks  smile

Offline

 

#2 2011-11-24 10:26:05

silvershine
Scratcher
Registered: 2010-11-21
Posts: 500+

Re: Game over --refreshing variables?

Hello!

I'm pretty sure what you want it to do is reset the variables after the green flag is clicked. This can be done with a very simple script:

http://img821.imageshack.us/img821/2955/help1i.png

Is that what you meant?  smile

Offline

 

#3 2011-11-24 10:27:02

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Game over --refreshing variables?

Use a broadcast. That way, whenever the broadcast is received, the variables will reset.


Why

Offline

 

#4 2011-11-24 10:37:02

Lar-Rew
Scratcher
Registered: 2010-02-19
Posts: 100+

Re: Game over --refreshing variables?

I seem to remember sci had a broadcast that effectively pressed the green flag button.  This won't refresh variables; you should do what silvershine said from that point.  However!  This will run any when-green-flag-clicked scripts.

Otherwise, what RedRocker said.

Offline

 

#5 2011-11-24 13:00:36

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

Re: Game over --refreshing variables?

Lar-Rew wrote:

I seem to remember sci had a broadcast that effectively pressed the green flag button.  This won't refresh variables; you should do what silvershine said from that point.  However!  This will run any when-green-flag-clicked scripts.

Otherwise, what RedRocker said.

It doesn't work in the Flash Player though.
The broadcast it scratch-startclicked BTW.

Offline

 

Board footer