Added hud
This commit is contained in:
parent
7e309db351
commit
31692d8b4e
6 changed files with 110 additions and 64 deletions
|
|
@ -1,37 +1,18 @@
|
|||
package ei.game.player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import ei.engine.scene.Node;
|
||||
import ei.game.scene.GameEntity;
|
||||
import ei.game.scene.units.Unit;
|
||||
import ei.game.scene.buildings.Building;
|
||||
import ei.game.scene.buildings.CommandCenter;
|
||||
|
||||
public class HumanPlayer extends Player{
|
||||
private ArrayList<GameEntity> units;
|
||||
private Node unitsNode;
|
||||
private CommandCenter cc;
|
||||
|
||||
public HumanPlayer(){
|
||||
units = new ArrayList<GameEntity>();
|
||||
unitsNode = new Node("HumanPlayerNode");
|
||||
super();
|
||||
cc = new CommandCenter(10,10,this);
|
||||
}
|
||||
|
||||
public void addUnit(GameEntity u){
|
||||
units.add(u);
|
||||
unitsNode.add(u.getNode());
|
||||
}
|
||||
|
||||
public void removeUnit(GameEntity u){
|
||||
units.remove(u);
|
||||
unitsNode.remove(u.getNode());
|
||||
}
|
||||
|
||||
public Node getNode(){
|
||||
return unitsNode;
|
||||
public Building getCC() {
|
||||
return cc;
|
||||
}
|
||||
|
||||
public void update() {
|
||||
for(int i=0; i<units.size() ;i++){
|
||||
units.get(i).update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue