I'm using the health bars based off of Fede-lasse's Fighting style health bars. here
I'm handling the action through a step of the Controller object. In addition, I'm creating objects on the fly to control them through the Controller object. My partial code from the step event:
//Sums of resources
energy_change=energy_get+energy_lose;
metal_change=metal_get+metal_lose;
energy_time+=1
metal_time+=1
//Regulating resources
if (energy_time >= 30)
{
if (inst.hp < inst.maximum) && (inst.hp >= 0)
{
inst.hp +=energy_change;
}
energy_time=0;
if(inst.hp == 0)
{
inst.hp += energy_get;
}
}
if (metal_time >= 30)
{
if (inst.hp < inst.maximum) && (inst.hp >= 0)
{
inst1.hp +=metal_change;
}
if(inst1.hp == 0)
{
inst1.hp += energy_get;
}
metal_time=0;
} What's wrong with my code(that is, if it's my code)?
Edited by goldsonic46, 04 July 2011 - 12:24 AM.











