Asdded a build menu to the hud and fixed some color isues with the new ProgressBar class
This commit is contained in:
parent
d1a2aa8b4e
commit
2cf489403d
10 changed files with 593 additions and 1168 deletions
|
|
@ -1,13 +1,8 @@
|
|||
package ei.game.scene;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import ei.engine.math.Vector2f;
|
||||
|
|
@ -15,7 +10,6 @@ import ei.engine.math.Vector2i;
|
|||
import ei.engine.math.Vector3f;
|
||||
import ei.engine.scene.Node;
|
||||
import ei.engine.scene.Sprite;
|
||||
import ei.engine.texture.TextureLoader;
|
||||
import ei.engine.util.MultiPrintStream;
|
||||
import ei.game.player.GaiaPlayer;
|
||||
import ei.game.player.Player;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import ei.engine.math.Vector2f;
|
|||
import ei.engine.math.Vector4f;
|
||||
import ei.engine.scene.Box;
|
||||
import ei.engine.scene.Node;
|
||||
import ei.engine.scene.Sprite;
|
||||
import ei.engine.texture.Texture;
|
||||
|
||||
public class SelectBox {
|
||||
|
|
@ -30,6 +29,9 @@ public class SelectBox {
|
|||
|
||||
bar = new ProgressBar("Health",x,height,max);
|
||||
bar.getNode().setLocation(new Vector2f(0,-x/2+height/2));
|
||||
bar.setValueColor(25, new Vector4f(1.0f, 0f, 0f, 1f));
|
||||
bar.setValueColor(50, new Vector4f(1.0f, .95f, 0, 1f));
|
||||
bar.setValueColor(100, new Vector4f(0.3f, 1.0f, 0.3f, 1f));
|
||||
selectNode.add(bar.getNode());
|
||||
mouseOverNode.add(bar.getNode());
|
||||
|
||||
|
|
|
|||
|
|
@ -1,26 +1,19 @@
|
|||
package ei.game.scene.buildings;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Queue;
|
||||
|
||||
import ei.engine.math.Vector2f;
|
||||
import ei.engine.math.Vector2i;
|
||||
import ei.engine.math.Vector3f;
|
||||
import ei.engine.scene.Node;
|
||||
import ei.game.algo.AStar;
|
||||
import ei.game.algo.AStarNode;
|
||||
import ei.game.gamestate.InGameState;
|
||||
import ei.game.player.Player;
|
||||
import ei.game.scene.GameEntity;
|
||||
import ei.game.scene.Map;
|
||||
import ei.game.scene.units.Unit;
|
||||
import ei.game.scene.weapons.Weapon;
|
||||
import ei.game.scene.weapons.WeaponHandler;
|
||||
|
||||
public abstract class Building extends GameEntity{
|
||||
private ArrayList<Unit> availableUnits;
|
||||
private Queue<Unit> buildQueue;
|
||||
private int buildTime;
|
||||
private Node unitNode;
|
||||
private Vector2i oldPos;
|
||||
private int size;
|
||||
|
|
@ -29,6 +22,7 @@ public abstract class Building extends GameEntity{
|
|||
public Building(int l, Vector2i pos, Player p, int size) {
|
||||
super(l, p);
|
||||
this.size = size;
|
||||
buildQueue = new LinkedList<Unit>();
|
||||
unitNode = new Node("UnitNode");
|
||||
unitNode.setLocation(Map.getPixelByPos(pos.getX(), pos.getY(), this.size));
|
||||
System.out.println("location: "+unitNode.getLocation());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue