Where i put that code?
Posted:
Tue Sep 14, 2010 3:17 am
by Wertyboy
Hi, so i put the code when dead where: Create Actor? Draw Actor?
- Code: Select all
if(hp=0)
{
Action...
}
Re: Where i put that code?
Posted:
Tue Sep 14, 2010 3:46 am
by skydereign
That would be draw actor, or better yet the event that reduces hp. That way you don't have to check every frame, instead only when the hp is depleted. So if you have a collision event that reduces hp, put it there. Create Actor is only called once, when the actor is created. Draw is every frame.
Re: Where i put that code?
Posted:
Tue Sep 14, 2010 8:20 am
by Bee-Ant
Draw Actor is okay...since there may be so many factors to reduce your HP.
Also, put == inside IF instead of only =
It would cause trouble