Page 1 of 1

Question about health.

PostPosted: Wed Sep 13, 2006 7:48 pm
by The achievement
Okay, im not doing any ancy health bar im just doing a number life bar. So anyway, i have collision on any side of my enemy and make it so the health goes - 15. so my problem is that if i hit the enemy it goes - 14, not to 75. how do i fix this? and i wanna do an if on zero. but anyway heres what im doing.
Code: Select all
 life.textNumber = life.textNumber - 15;



when the life gets to zero can i do, if (life) = <0; Destroy Actor ("player");

PostPosted: Wed Sep 13, 2006 8:13 pm
by makslane
On 'Create Actor' event of your life actor, put

Code: Select all
textNumber = 100;


And the right test condition is:

Code: Select all
if (life.textNumber =< 0) DestroyActor("player");

PostPosted: Wed Sep 13, 2006 10:36 pm
by Game A Gogo
[quote="makslane"]
Code: Select all
if (life.textNumber =< 0) DestroyActor("player");
[/quote
what is that "=" is doing there??

PostPosted: Wed Sep 13, 2006 10:44 pm
by makslane
Ops...
Use <= or <