Health Codes

Talk about making games.

Health Codes

Postby Hedfone » Wed Oct 25, 2006 9:36 pm

alright, I know that the topic of health bars/accesories has been flogged to death on this forum but....once more,

on the 'Create Actor' of my health meter I place the code:

Code: Select all
animpos=nframes;


and change the animation direction to stopped.

Then, on the collision with my enemy, I put the code:

Code: Select all
Health.animpos=-1;
if ((Health.animpos-1)<0)
{
DestroyActor ("Player");
}


This WOULD be fine except that when I collide, it kills him automatically. What am I doing wrong?
User avatar
Hedfone
 
Posts: 174
Joined: Mon Jul 31, 2006 9:47 pm
Score: 2 Give a positive score

Postby makslane » Wed Oct 25, 2006 10:30 pm

Use this:

Code: Select all
Health.animpos -= 1;
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Hedfone » Wed Oct 25, 2006 10:35 pm

thanks makslane, once again you've saved my game's butt :D
User avatar
Hedfone
 
Posts: 174
Joined: Mon Jul 31, 2006 9:47 pm
Score: 2 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest