Please help… this is for my thesis…
PROBLEM: I don’t know what’s the reason why in the first if block statement of this function “if(_root.hp_mc._width < 10){” after the condition get satisfied once, the next turn it would satisfy again, the variable life and heart didn’t reduce to 1…
|| i have a life_mc1,life_mc2,life_mc3 = a graphical representation of remaining life which should be redue/hide one by one if the first if condition will be satisfied… and when the life is less than 0 the game will be over… please help me…
function hpLife(){ // health bar subtraction
_root.hp_mc._width = (_root.hp_mc._width - subHealth);
// Heart subtraction
if(_root.hp_mc._width < 10){
_root["life_mc" + heart]._visible = false;
_root.hp_mc._width = 127;
maxHealth = 127;
life--;
heart--;
// Life Number Subtraction
if(life < 4){
gotoAndStop("control");
}
}
}
var heart:Number = 3; //Used as life_mc1, life_mc2, life_mc3....
var life:Number = 4; // Used as starting Life
var maxHealth:Number = _root.hp_mc._width(); //Used as HP BAR
var subHealth:Number = 31.75; //Used to Subtract HP BAR