diff --git a/src/data/hud/money.png b/src/data/hud/money.png new file mode 100644 index 0000000..d211ba0 Binary files /dev/null and b/src/data/hud/money.png differ diff --git a/src/data/sounds/center.wav b/src/data/sounds/center.wav deleted file mode 100644 index 29e6dde..0000000 Binary files a/src/data/sounds/center.wav and /dev/null differ diff --git a/src/data/sounds/ei.wav b/src/data/sounds/ei.wav deleted file mode 100644 index 76217b1..0000000 Binary files a/src/data/sounds/ei.wav and /dev/null differ diff --git a/src/data/sounds/left.wav b/src/data/sounds/left.wav deleted file mode 100644 index 87635a5..0000000 Binary files a/src/data/sounds/left.wav and /dev/null differ diff --git a/src/data/sounds/right.wav b/src/data/sounds/right.wav deleted file mode 100644 index f23dbed..0000000 Binary files a/src/data/sounds/right.wav and /dev/null differ diff --git a/src/ei/engine/effects/ProgressBar.java b/src/ei/engine/effects/ProgressBar.java index b8109cc..3753837 100644 --- a/src/ei/engine/effects/ProgressBar.java +++ b/src/ei/engine/effects/ProgressBar.java @@ -36,12 +36,10 @@ public class ProgressBar{ value = new Sprite(name+"_Value",tex2); value.setSize(new Vector2f(width,height)); - value.setLocation(new Vector2f(0,-50)); progressNode.add(value); bar = new Box(name+"_Bar",tex); bar.setSize(new Vector2f(width,height)); - bar.setLocation(new Vector2f()); progressNode.add(bar); } diff --git a/src/ei/game/gamestate/InGameState.java b/src/ei/game/gamestate/InGameState.java index dbeb138..3f0675f 100644 --- a/src/ei/game/gamestate/InGameState.java +++ b/src/ei/game/gamestate/InGameState.java @@ -41,7 +41,7 @@ public class InGameState extends GameState{ player.addUnit(new Bomber(7, 0, player)); player.addUnit(new APU(4, 0, player)); player.addUnit(new APU(5, 0, player)); - player.addUnit(new CommandCenter(10, 10, player)); + //player.addUnit(new CommandCenter(10, 10, player)); PlayerHandler.getInstance().addPlayer(player); diff --git a/src/ei/game/hud/InGameHud.java b/src/ei/game/hud/InGameHud.java index 179e58a..6ef9e1d 100644 --- a/src/ei/game/hud/InGameHud.java +++ b/src/ei/game/hud/InGameHud.java @@ -4,6 +4,7 @@ import ei.engine.LWJGLGameWindow; import ei.engine.effects.BitmapText; import ei.engine.math.Vector2f; import ei.engine.scene.Node; +import ei.engine.scene.Sprite; import ei.game.player.Player; public class InGameHud { @@ -16,14 +17,20 @@ public class InGameHud { hudNode = new Node("Hud"); + Sprite moneyBack = new Sprite("MoneyBackground","data/hud/money.png"); + moneyBack.setLocation(new Vector2f( + LWJGLGameWindow.getWidth()-moneyBack.getSize().getX()/2, + moneyBack.getSize().getY()/2)); + hudNode.add(moneyBack); + money = new BitmapText("MoneyMeter"); - money.setLocation(new Vector2f(LWJGLGameWindow.getWidth()-money.getBound().width,0)); + money.setLocation(new Vector2f(LWJGLGameWindow.getWidth()-money.getBound().width,5)); hudNode.add(money); } public void update(){ money.setText(""+player.getKredits()); - money.setLocation(new Vector2f(LWJGLGameWindow.getWidth()-money.getBound().width,0)); + money.setLocation(new Vector2f(LWJGLGameWindow.getWidth()-money.getBound().width,5)); player.addKredits(100); diff --git a/src/ei/game/player/HumanPlayer.java b/src/ei/game/player/HumanPlayer.java index 8868bbe..29ad65a 100644 --- a/src/ei/game/player/HumanPlayer.java +++ b/src/ei/game/player/HumanPlayer.java @@ -9,6 +9,7 @@ public class HumanPlayer extends Player{ public HumanPlayer(){ super(); cc = new CommandCenter(10,10,this); + addUnit(cc); } public Building getCC() { diff --git a/src/ei/game/scene/SelectBox.java b/src/ei/game/scene/SelectBox.java index 1e035d1..d1016e6 100644 --- a/src/ei/game/scene/SelectBox.java +++ b/src/ei/game/scene/SelectBox.java @@ -9,12 +9,10 @@ import ei.engine.scene.Sprite; import ei.engine.texture.Texture; public class SelectBox { + private static final float height = 3; private Node selectNode; private Node mouseOverNode; private ProgressBar bar; - private int max; - private float width; - private static final float height = 3; /** * Creates a selection box with health bar @@ -24,15 +22,13 @@ public class SelectBox { * @param max The max health of the object */ public SelectBox(float x, float y, int max){ - this.max = max; - this.width = x; selectNode = new Node("SelectionNode"); mouseOverNode = new Node("MouseOverNode"); Texture tex = new Texture(); tex.setColor(new Vector4f(0.5f, 1.0f, 0.5f,1)); - bar = new ProgressBar("Health",width,height,max); + bar = new ProgressBar("Health",x,height,max); bar.getNode().setLocation(new Vector2f(0,-x/2+height/2)); selectNode.add(bar.getNode()); mouseOverNode.add(bar.getNode()); diff --git a/src/ei/game/scene/units/APU.java b/src/ei/game/scene/units/APU.java index 4e00828..cbaf118 100644 --- a/src/ei/game/scene/units/APU.java +++ b/src/ei/game/scene/units/APU.java @@ -27,11 +27,18 @@ public class APU extends Unit{ this.sprite = new Sprite("APU", "data/units/apu/apu0000.png"); sprite.setSize(new Vector2f(40,40)); getNode().add(sprite); + gunSound = new Sound("gunSound", "data/sounds/machinegun.wav"); moveSound[0] = new Sound("moveSound", "data/sounds/APUmove1.wav"); moveSound[1] = new Sound("moveSound", "data/sounds/APUmove2.wav"); selectSound = new Sound("selectSound", "data/sounds/APUselect.wav"); attackSound = new Sound("attackSound", "data/sounds/APUattack.wav"); + + gunSound.setLocation(getNode().getLocation()); + moveSound[0].setLocation(getNode().getLocation()); + moveSound[1].setLocation(getNode().getLocation()); + selectSound.setLocation(getNode().getLocation()); + attackSound.setLocation(getNode().getLocation()); selectionBox = new SelectBox(40,40,getMaxLife()); } diff --git a/src/ei/game/scene/units/Bomber.java b/src/ei/game/scene/units/Bomber.java index 0f027f3..2a7113d 100644 --- a/src/ei/game/scene/units/Bomber.java +++ b/src/ei/game/scene/units/Bomber.java @@ -27,12 +27,19 @@ public class Bomber extends Unit{ this.sprite = new Sprite("Bomber", "data/units/bomber/bomber0000.png"); sprite.setSize(new Vector2f(50,60)); getNode().add(sprite); + gunSound = new Sound("gunSound", "data/sounds/bomberweapon.wav"); moveSound[0] = new Sound("moveSound", "data/sounds/BOMBERmove1.wav"); moveSound[1] = new Sound("moveSound", "data/sounds/BOMBERmove2.wav"); selectSound = new Sound("selectSound", "data/sounds/BOMBERselect.wav"); attackSound = new Sound("attackSound", "data/sounds/BOMBERattack.wav"); - + + gunSound.setLocation(getNode().getLocation()); + moveSound[0].setLocation(getNode().getLocation()); + moveSound[1].setLocation(getNode().getLocation()); + selectSound.setLocation(getNode().getLocation()); + attackSound.setLocation(getNode().getLocation()); + selectionBox = new SelectBox(40,40,getMaxLife()); } diff --git a/src/ei/game/scene/units/Tank.java b/src/ei/game/scene/units/Tank.java index a15f715..45fc6be 100644 --- a/src/ei/game/scene/units/Tank.java +++ b/src/ei/game/scene/units/Tank.java @@ -34,6 +34,12 @@ public class Tank extends Unit{ selectSound = new Sound("selectSound", "data/sounds/TANKselect.wav"); attackSound = new Sound("attackSound", "data/sounds/TANKattack.wav"); + gunSound.setLocation(getNode().getLocation()); + moveSound[0].setLocation(getNode().getLocation()); + moveSound[1].setLocation(getNode().getLocation()); + selectSound.setLocation(getNode().getLocation()); + attackSound.setLocation(getNode().getLocation()); + selectionBox = new SelectBox(40,40,getMaxLife()); }