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

#1 2011-06-15 11:43:38

jkoch1212
New Scratcher
Registered: 2011-06-15
Posts: 1

Game over screen

One of my students is trying to get a game over screen when his life variable gets to zero. I keep looking for other forums where this could have been asked but the suggestions I have seen have not worked for me. If someone could let me know ASAP the easiest way to do this. Thanks!

Jessica

Offline

 

#2 2011-06-15 11:51:39

coca0101
Scratcher
Registered: 2011-05-15
Posts: 63

Re: Game over screen

I can!!!
<when green flag clicked>
<forever>
   <if>  <( <{ Lives }> <=> 0 )>
<switch to costume[ Game over
<end>
<end>

Last edited by coca0101 (2011-06-15 11:52:21)

Offline

 

#3 2011-06-15 11:53:26

meew0
Scratcher
Registered: 2010-02-22
Posts: 1000+

Re: Game over screen

Try this:
http://i.imgur.com/K9jRT.gif
I hope it helped.  smile


http://i.imgur.com/mJV3j.pnghttp://i.imgur.com/HwWAX.pnghttp://i.imgur.com/sZ7Ui.pnghttp://i.imgur.com/0y6yh.pnghttp://i.imgur.com/nOC4l.png

Offline

 

#4 2011-06-15 13:07:02

EdnaC
Scratcher
Registered: 2007-08-28
Posts: 100+

Re: Game over screen

For games, I usually have a sprite dedicated to putting up instructions (a start screen costume) and a game over message (another costume).  The script that is counting down the life variable can send a broadcast when this variable reaches zero.  In the "start/gameover" sprite, receiving this message can trigger a costume change to show that the game has ended. 

I did this in "EarthDefense":  http://scratch.mit.edu/projects/EdnaC/1856425

Continuously monitoring as coca0101 suggests works too, but the broadcast method lets other sprites react to the message too.

Last edited by EdnaC (2011-06-16 10:59:31)

Offline

 

Board footer