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

#1 2012-07-04 15:27:42

ZombieHappines
Scratcher
Registered: 2012-01-19
Posts: 100+

health

i am making a game and i have a gameover sprite and i want that when health variable is zero it shows and then stops all
this is what i have and it does not work

when gf clicked
forever if
Health = 0
show
stop all


http://i47.tinypic.com/10wr3bq.jpg
http://i50.tinypic.com/2w7onpy.png

Offline

 

#2 2012-07-04 15:30:56

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: health

when gf clicked
wait until <(health)=[0]>
show
stop all


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#3 2012-07-04 15:37:33

ZombieHappines
Scratcher
Registered: 2012-01-19
Posts: 100+

Re: health

that doesnt work if i even touch a zombie it shows it and stops all and p.s i just became a scratcher how do i get the thing under our text


http://i47.tinypic.com/10wr3bq.jpg
http://i50.tinypic.com/2w7onpy.png

Offline

 

#4 2012-07-04 15:44:37

skippito
Scratcher
Registered: 2012-03-17
Posts: 100+

Re: health

This should work:
http://i46.tinypic.com/2mpk13d.gif

Your problem is that the sprite does not hide at the beginning and the health is not reset. Even if these do happen, they must within the script for it to work all the time. Also, if health changes greatly, you may not want it to check for a value equal to zero because it could become less than zero without actually becoming zero.

Last edited by skippito (2012-07-04 15:46:07)

Offline

 

#5 2012-07-04 15:50:55

ZombieHappines
Scratcher
Registered: 2012-01-19
Posts: 100+

Re: health

skippito wrote:

This should work:
http://i46.tinypic.com/2mpk13d.gif

Your problem is that the sprite does not hide at the beginning and the health is not reset. Even if these do happen, they must within the script for it to work all the time. Also, if health changes greatly, you may not want it to check for a value equal to zero because it could become less than zero without actually becoming zero.

i did have it hidden and the health reset when flag clicked and your script did not work

Last edited by ZombieHappines (2012-07-04 15:51:30)


http://i47.tinypic.com/10wr3bq.jpg
http://i50.tinypic.com/2w7onpy.png

Offline

 

#6 2012-07-04 21:01:29

ZombieHappines
Scratcher
Registered: 2012-01-19
Posts: 100+

Re: health

hello can anyone help me


http://i47.tinypic.com/10wr3bq.jpg
http://i50.tinypic.com/2w7onpy.png

Offline

 

#7 2012-07-04 21:19:38

hdarken
Scratcher
Registered: 2008-06-26
Posts: 1000+

Re: health

Can you link the project to me, it could be that if you have a block like

when [space v] key pressed
that you don't need the green flag for it to work. You only can use Stop all for things that start with:
when flag clicked

Last edited by hdarken (2012-07-04 21:22:10)


http://i.imgur.com/VskBk.png
http://i.imgur.com/tgxVZ.jpg

Offline

 

#8 2012-07-05 11:02:27

ZombieHappines
Scratcher
Registered: 2012-01-19
Posts: 100+

Re: health

hdarken wrote:

Can you link the project to me, it could be that if you have a block like

when [space v] key pressed
that you don't need the green flag for it to work. You only can use Stop all for things that start with:
when flag clicked

ok so here is a link to an earlier version it does have the health bar but not the gamever screen http://scratch.mit.edu/projects/ZombieHappines/2652393

Last edited by ZombieHappines (2012-07-05 11:04:19)


http://i47.tinypic.com/10wr3bq.jpg
http://i50.tinypic.com/2w7onpy.png

Offline

 

#9 2012-07-05 13:31:43

ZombieHappines
Scratcher
Registered: 2012-01-19
Posts: 100+

Re: health

will someone help me


http://i47.tinypic.com/10wr3bq.jpg
http://i50.tinypic.com/2w7onpy.png

Offline

 

Board footer