fix: Player and Moon movement now independant of FPS
This commit is contained in:
parent
1b31744397
commit
68693e1cff
|
@ -32,7 +32,7 @@ public class Moon extends Planet {
|
|||
|
||||
@Override
|
||||
public void act(float dt) {
|
||||
this.angle += 10.0f / this.altitude;
|
||||
this.angle += 2000.0f / this.altitude * dt;
|
||||
this.setX(sun.getX() + this.altitude * MathUtils.cosDeg(this.angle));
|
||||
this.setY(sun.getY() + this.altitude * MathUtils.sinDeg(this.angle));
|
||||
super.act(dt);
|
||||
|
|
|
@ -91,10 +91,10 @@ public class Player extends EntityQuad {
|
|||
|
||||
if (active) {
|
||||
if (Gdx.input.isKeyPressed(SagittariusGame.moveLeftKey)) {
|
||||
this.angle += 100.0f / home.getRadius();
|
||||
this.angle += 10000.0f / home.getRadius() * dt;
|
||||
}
|
||||
if (Gdx.input.isKeyPressed(SagittariusGame.moveRightKey)) {
|
||||
this.angle -= 100.0f / home.getRadius();
|
||||
this.angle -= 10000.0f / home.getRadius() * dt;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue