This commit is contained in:
parent
c51f744f8f
commit
ea2589edf3
1 changed files with 11 additions and 4 deletions
|
|
@ -2,18 +2,23 @@ package ei.game.gamestate;
|
|||
|
||||
import ei.engine.scene.Node;
|
||||
import ei.engine.scene.Sprite;
|
||||
import ei.engine.sound.Sound;
|
||||
import ei.engine.state.GameState;
|
||||
|
||||
|
||||
public class InGameState extends GameState{
|
||||
private Node rootNode;
|
||||
private Sprite s1;
|
||||
private Sprite sprite1;
|
||||
private Sound sound1;
|
||||
|
||||
public InGameState(String name){
|
||||
super(name);
|
||||
rootNode = new Node("InGameNode");
|
||||
s1 = new Sprite("tank","data/units/tank.png");
|
||||
rootNode.add(s1);
|
||||
sprite1 = new Sprite("tank","data/units/tank.png");
|
||||
rootNode.add(sprite1);
|
||||
sound1 = new Sound("sound","data/sounds/test.wav");
|
||||
sound1.play(1, 1);
|
||||
rootNode.add(sound1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -23,7 +28,9 @@ public class InGameState extends GameState{
|
|||
|
||||
@Override
|
||||
public void update() {
|
||||
s1.getLocation().add(0.1);
|
||||
sprite1.getLocation().add(0.1f);
|
||||
sound1.getLocation().add(0.1f);
|
||||
rootNode.update();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue