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

#1 2012-04-14 20:32:51

YDPO
New Scratcher
Registered: 2012-04-14
Posts: 1

How do i make a GAME OVER

I want that all the scripts of action stop and make the one that makes that if life reaches 0, switch costumes. The problem is that when life reaches 0, if im pressing a button that performs an action, it continues doing it until it games over or i stop pressing it. Can you help me with that? Thank you!

Offline

 

#2 2012-04-14 20:36:38

trinary
Scratcher
Registered: 2012-01-29
Posts: 1000+

Re: How do i make a GAME OVER

Could you post your current scripts?


http://trinary.tk/images/signature_.php

Offline

 

#3 2012-04-14 22:51:49

K-Jam
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: How do i make a GAME OVER

when clicked
forever
if
life
=
0
broadcast
end

When I recieve
end
stop all
When clicked
forever
if
mouse-pointer down
repeat until
not (mouse-pointer down)
do action

Last edited by K-Jam (2012-04-14 22:52:26)


http://images.inmagine.com/img/imagezoo/iz162/Iz162012.jpg COMPASS!!!

Offline

 

#4 2012-04-14 23:48:07

aryabtsev
Scratcher
Registered: 2012-02-05
Posts: 81

Re: How do i make a GAME OVER

Maybe have a variable that's set to "yes" when flag is clicked and then when lives reach 0 set it to "no". Then put all the action into

if
variable
=
yes
action

Last edited by aryabtsev (2012-04-14 23:48:30)


http://i.imgur.com/NX7AO.jpg

Offline

 

#5 2012-04-15 00:21:22

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: How do i make a GAME OVER

Make a script that says, when life equals zero, change to whatever costume you were wanting, broadcast end game and wait, stop all. On your other sprites, have a script that says, when I recieve end game, hide. For an example, download the Tanks project in my signature below. It has this type of scripting.


Why are the secret organizations getting all the attention?  mad

Offline

 

#6 2012-04-15 06:19:16

Splodgey
Scratcher
Registered: 2011-04-26
Posts: 500+

Re: How do i make a GAME OVER

Instead of using forever blocks use:

repeat until
lives
=
0
do whatever
death action
you will only need the death action on [b]one script[/b].

K-Jam wrote:

when clicked
forever
if
life
=
0
broadcast
end

When I recieve
end
stop all
When clicked
forever
if
mouse-pointer down
repeat until
not (mouse-pointer down)
do action

If you're doing that the broadcast is unnecessary.

when clicked
forever
if
life
=
0
stop all

Last edited by Splodgey (2012-04-15 06:21:57)

Offline

 

Board footer