Added a small and simple test EI.java. and fixed some buggs
This commit is contained in:
parent
bea0632d5d
commit
dbee794932
8 changed files with 150 additions and 53 deletions
|
|
@ -1,5 +1,20 @@
|
|||
package ei.game;
|
||||
|
||||
public class EI {
|
||||
import ei.engine.LWJGLGameWindow;
|
||||
import ei.engine.state.GameStateManager;
|
||||
import ei.game.gamestate.InGameState;
|
||||
|
||||
public class EI extends LWJGLGameWindow{
|
||||
public static void main(String[] args){
|
||||
new EI();
|
||||
}
|
||||
|
||||
public EI() {
|
||||
super("EI");
|
||||
}
|
||||
|
||||
protected void init(){
|
||||
GameStateManager.getInstance().addState(new InGameState("InGameState"));
|
||||
GameStateManager.getInstance().setActive("InGameState");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
30
src/ei/game/gamestate/InGameState.java
Normal file
30
src/ei/game/gamestate/InGameState.java
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package ei.game.gamestate;
|
||||
|
||||
import ei.engine.scene.Node;
|
||||
import ei.engine.scene.Sprite;
|
||||
import ei.engine.state.GameState;
|
||||
|
||||
|
||||
public class InGameState extends GameState{
|
||||
private Node rootNode;
|
||||
private Sprite s1;
|
||||
|
||||
public InGameState(String name){
|
||||
super(name);
|
||||
rootNode = new Node("InGameNode");
|
||||
s1 = new Sprite("tank","data/units/tank.png");
|
||||
rootNode.add(s1);
|
||||
s1.setLocation(1, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
rootNode.render();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
s1.getLocation().add(1);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue