fix: Player and Moon movement now independant of FPS

This commit is contained in:
Laureηt 2021-05-27 11:45:53 +02:00
parent 1b31744397
commit 68693e1cff
2 changed files with 3 additions and 3 deletions

View file

@ -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);

View file

@ -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;
}
}