Call the same object from library each one has it own properties.
I have some enemies(let say 10 enemies) on stage with the same instance names "enemy".
Each enemy have 4 hitpoints.
When a bullet hit a enemy the enemy remove from stage and a new enemy (enemy2) spawn on stage.
How can i do the spawn enemy to have let say 4 hitpoints?
Here is what i do for the enemies on stage to have 4 hitpoints.
var enemyArray:Array = new Array();
for (var e:int = numChildren - 1; e>= 0; e--)
{
var childe:DisplayObject = getChildAt(e);
if (childe.name == "enemy")
{
enemyArray.push(MovieClip(childe));
MovieClip(childe).hitpoints = 4;
}
}
