Added health bar

This commit is contained in:
Ziver Koc 2007-04-17 12:51:26 +00:00
parent f7c3a895f0
commit adbfa34350
4 changed files with 113 additions and 26 deletions

View file

@ -2,14 +2,11 @@ package ei.game.scene.units;
import ei.engine.math.Vector2f;
import ei.engine.math.Vector2i;
import ei.engine.math.Vector4f;
import ei.engine.scene.Box;
import ei.engine.scene.Entity;
import ei.engine.scene.Sprite;
import ei.engine.texture.Texture;
import ei.game.scene.SelectBox;
public class Tank extends Unit{
private Box box;
private SelectBox selectionBox;
public Tank() {
this(0, 0);
}
@ -19,17 +16,12 @@ public class Tank extends Unit{
Sprite sp = new Sprite("Tank", "data/units/tank.png");
sp.setSize(new Vector2f(50,37));
getNode().add(sp);
Texture tex = new Texture();
tex.setColor(new Vector4f(0.5f, 1.0f, 0.5f,1));
box = new Box("selectionBox",tex);
box.setSize(new Vector2f(40,40));
selectionBox = new SelectBox(40,40,getMaxLife());
}
protected Entity getSelection() {
return box;
protected SelectBox getSelection() {
return selectionBox;
}