initial commit, kind of working.
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import com.arc.flixel.ArcGroup;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
|
||||
public class Healthbar extends ArcGroup
|
||||
{
|
||||
|
||||
public static const WIDTH:int = 15;
|
||||
|
||||
public static const HEIGHT:int = 6;
|
||||
|
||||
private static const BORDER_WIDTH:int = 2;
|
||||
|
||||
private var backgroundSprite:Class = Healthbar_backgroundSprite;
|
||||
|
||||
private var barSprite:Class = Healthbar_barSprite;
|
||||
|
||||
private var background:ArcSprite;
|
||||
|
||||
public var bar:ArcSprite;
|
||||
|
||||
public function Healthbar()
|
||||
{
|
||||
super();
|
||||
this.background = new ArcSprite(0,0);
|
||||
this.background.loadGraphic(this.backgroundSprite,false,false,WIDTH,HEIGHT);
|
||||
add(this.background);
|
||||
this.bar = new ArcSprite(BORDER_WIDTH,BORDER_WIDTH);
|
||||
this.bar.loadGraphic(this.barSprite,false,false,11,2);
|
||||
this.bar.origin.x = this.bar.origin.y = 0;
|
||||
this.bar.addAnimation("red",[0]);
|
||||
this.bar.addAnimation("gold",[1]);
|
||||
this.bar.play("red");
|
||||
add(this.bar);
|
||||
alive = true;
|
||||
exists = true;
|
||||
}
|
||||
|
||||
public function move(param1:int, param2:int, param3:Number) : void
|
||||
{
|
||||
this.background.alpha = param3;
|
||||
this.background.x = param1;
|
||||
this.background.y = param2;
|
||||
this.bar.alpha = param3;
|
||||
this.bar.x = param1 + BORDER_WIDTH;
|
||||
this.bar.y = param2 + BORDER_WIDTH;
|
||||
}
|
||||
|
||||
public function scale(param1:Number) : void
|
||||
{
|
||||
this.bar.scale.x = param1;
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user