This commit is contained in:
Ziver Koc 2007-04-04 14:45:44 +00:00
parent f7c37665e1
commit 1ffdb1015f
4 changed files with 29 additions and 4 deletions

View file

@ -3,12 +3,14 @@ package ei.game.gamestate;
import ei.engine.scene.Node; import ei.engine.scene.Node;
import ei.engine.state.GameState; import ei.engine.state.GameState;
import ei.game.input.InGameMouseInput; import ei.game.input.InGameMouseInput;
import ei.game.player.Human;
import ei.game.scene.Map; import ei.game.scene.Map;
public class InGameState extends GameState{ public class InGameState extends GameState{
private Node rootNode; private Node rootNode;
private Map map; private Map map;
private Human player;
public InGameState(String name){ public InGameState(String name){
super(name); super(name);
@ -19,7 +21,8 @@ public class InGameState extends GameState{
map = new Map(20,20); map = new Map(20,20);
rootNode.add(map.getMapNode()); rootNode.add(map.getMapNode());
player = new Human();
rootNode.add(player.getNode());
} }
public void render() { public void render() {

View file

@ -102,7 +102,6 @@ public class LoadingState extends GameState{
public void render() { public void render() {
// Calculate the procentage // Calculate the procentage
float procent = (float)status/100;//(loadTextures.size()+loadSounds.size()); float procent = (float)status/100;//(loadTextures.size()+loadSounds.size());
System.out.println("lol: "+procent);
loadBar.setLocation(new Vector3f( loadBar.setLocation(new Vector3f(
(LWJGLGameWindow.getWidth()/2)-loadBar.getWidth()+(loadBar.getWidth()*procent), (LWJGLGameWindow.getWidth()/2)-loadBar.getWidth()+(loadBar.getWidth()*procent),
(LWJGLGameWindow.getHeight()/2)+6,0.0f)); (LWJGLGameWindow.getHeight()/2)+6,0.0f));

View file

@ -1,5 +1,27 @@
package ei.game.player; package ei.game.player;
public class Human { import java.util.ArrayList;
import ei.engine.scene.Node;
import ei.game.scene.GameEntity;
import ei.game.scene.units.Unit;
public class Human {
private ArrayList<GameEntity> units;
private Node unitsNode;
public Human(){
units = new ArrayList<GameEntity>();
unitsNode = new Node("UnitsNode");
}
public void addUnit(Unit u){
units.add(u);
unitsNode.add(u.getSprite());
}
public Node getNode(){
return unitsNode;
}
} }

View file

@ -1,13 +1,14 @@
package ei.game.scene.buildings; package ei.game.scene.buildings;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Queue;
import ei.game.scene.GameEntity; import ei.game.scene.GameEntity;
import ei.game.scene.units.Unit; import ei.game.scene.units.Unit;
public abstract class Building extends GameEntity{ public abstract class Building extends GameEntity{
private ArrayList<Unit> availableUnits; private ArrayList<Unit> availableUnits;
private ArrayList<Unit> buildQueue; private Queue<Unit> buildQueue;
public Building(int l) { public Building(int l) {
super(l); super(l);