Game Development Community

Enemy hitpoints in Gamekit

by John Bura · in Torque X 2D · 06/22/2010 (7:58 am) · 7 replies

Hi there,

I have been trying to adjust the heath of the enemies. But when I adjust the health nothing seems to happen. Its always a 1 shot kill scenario. I must be overlooking something really basic here.

Has anybody solved this?

#1
06/22/2010 (10:42 am)
Should have posted in the Platformer Starter Kit forums. I wonder how you are changing the health, are you using the TXB editor? Because that value is loaded in from there. If you want the health in code, you have to do it after the object is registered. When the object is registered the health is set by the value that was set in the editor. When I looked at the code, I noticed most things did 100 damage, or had 100 health. So changing those values in the editor should fix things.
#2
06/22/2010 (11:29 am)
I was referring to the gamekit health.
#3
06/22/2010 (12:08 pm)
Check the T2DCollision component for the enemy. Set ResolveCollision to none. I bet it's set to killcollision. Also I usually set the hero projectiles to killcollision. If you do not they will make more than one collision.

Let me know if that does it.
#4
06/22/2010 (12:24 pm)
Thanks Henry you saved me a lot of time :)
It worked perfectly :)
#5
06/22/2010 (9:13 pm)
Quote:Should have posted in the Platformer Starter Kit forums.

Henry made a little gamekit for people with various components that he uses for prototyping. It's a nice little package to learn what you are doing on it.

www.torquepowered.com/community/forums/viewthread/109315
#6
06/23/2010 (7:11 am)
So if I don't set the collision to kill. When the enemy hits the hero it just bounces off. Is there anyway to set have the sprite disappear?
#7
06/23/2010 (8:33 am)
Give your hero a dealsDamage component and when the enemy hits the hero it will take damage and be destroyed just like being hit by a bullet. If you want your enemy collision to also damage the hero give the enemy a dealsDamage as well.