Hi,
I'm modifing a game based on the turret defence game template .
I want to add a health bar to each new enemy, so when an enemy is spawned I also spawn an healthBar spite and pin it to the enemy. Every time the enemy is hit I modify the healthBar width to enemy's health instance variable.
This method doesn't work as all healthBar on the screen get the same value and are destroyed when the first enemy is detroyed...
Spawning a healthBar when Spawning a new enemy
[attachment=1:3881wngr][/attachment:3881wngr]
Adjusting the healthBar as enemy gets hit
[attachment=0:3881wngr][/attachment:3881wngr]
How can I adjust the only hit enemy's healthBar?
How can I destroy the healthBar when the enemy iss dead?
TNX!!!