Fixed the rotation pivot and added scalability
This commit is contained in:
parent
f25b07910e
commit
01af69cbc8
5 changed files with 33 additions and 21 deletions
|
|
@ -15,10 +15,13 @@ public class InGameState extends GameState{
|
|||
public InGameState(String name){
|
||||
super(name);
|
||||
rootNode = new Node("InGameNode");
|
||||
|
||||
sprite1 = new Sprite("tank","data/units/tank.png");
|
||||
sprite1.setScale(new Vector2f(0.5f,0.5f));
|
||||
rootNode.add(sprite1);
|
||||
|
||||
sound1 = new Sound("sound","data/sounds/test.wav");
|
||||
sound1.play();
|
||||
sound1.loop();
|
||||
rootNode.add(sound1);
|
||||
}
|
||||
|
||||
|
|
@ -29,7 +32,7 @@ public class InGameState extends GameState{
|
|||
|
||||
@Override
|
||||
public void update() {
|
||||
sprite1.getLocation().add(0.1f);
|
||||
sprite1.getLocation().add(0.5f);
|
||||
sprite1.getRotation().add(0, 0, 0.5f);
|
||||
sound1.getLocation().add(new Vector2f(1,0));
|
||||
rootNode.update();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue