there is probably a tutorial out there somewhere, but i cant find it, anyways, Ive been trying to make health using variables, and so far, its not going too good, I need to know how to make a sprite "die" when it's health variable reaches 0, can someone please tell me how?
Offline
The sprite who has the health:
<when green flag clicked>
<wait until> << <( <{ health }> <=> 0 )> <or> <( <{ health }> <<> 0 )> >>
<broadcast[ game over
The sprite that shows Game over sign:
<when I receive[ game over
<show>
<go to front>
<stop all>
If you need more help, ask me on my Messaging Center
Last edited by ihaveamac (2008-02-18 04:51:41)
Offline
Thank you so much, tha just made this project so much easier
Offline
To answer your question,
You wrote:
ok, the thing you told me, it didnt work, its probably because i did it wrong,ill tell you the whole story so far: I press the button, which makes the guy shoot, minusing the health of the enemy by 0 - 20, when the enemie's reaches 0, he is supposed to dissapear, (because he walks forever), and the exact same looking sprite, except with costumes of dying, is supposed to take his place then dissapear, then the first enemy (walking one) reappears and this keeps on happening, can you please help me with this?
Ok. The enemy's script:
<when green flag clicked>
<forever>
<the enemy's actions here>
<if> << <( <{ health }> <=> 0 )> <or> <( <{ health }> <<> 0 )> >>
<hide>
<change{ score }by( 1 (if you are putting a score in it)
<wait( <pick random( 1 )to( 10 )secs>
<show>
<go to x 240 )y <pick random( -180 )to( 180
<end>
<end>
Did this help?
Offline