farban
March 8th, 2009, 06:26 PM
Heya there just havig a stupid problem where the health on my game increases on my game instead of decreases when the player is hit.
here is the source code
HUD.as (Scoreboard)
private var stageRef:Stage;
public var s_score:Number = 0;
public var s_kills:Number = 0;
public var s_health:Number = 0;
health.text = "100";
public function updateHits(value:Number) : void
{
s_health += value;
health.text = String(s_health);
}
}
}engine.as (game engine)
private function shipHit(e:Event) : void
{
theHUD.updateHits(1);
}thanks for any help
here is the source code
HUD.as (Scoreboard)
private var stageRef:Stage;
public var s_score:Number = 0;
public var s_kills:Number = 0;
public var s_health:Number = 0;
health.text = "100";
public function updateHits(value:Number) : void
{
s_health += value;
health.text = String(s_health);
}
}
}engine.as (game engine)
private function shipHit(e:Event) : void
{
theHUD.updateHits(1);
}thanks for any help