From 83113f3afd4158d8802c77d24715f5012f511d00 Mon Sep 17 00:00:00 2001 From: Matt Low Date: Fri, 24 Jan 2020 17:39:22 +0400 Subject: [PATCH] Rotate at a frame time dependent rate (300 degrees / second) --- core/src/com/me/asteroids/systems/PlayerInputSystem.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/com/me/asteroids/systems/PlayerInputSystem.java b/core/src/com/me/asteroids/systems/PlayerInputSystem.java index dc597aa..bed9c05 100644 --- a/core/src/com/me/asteroids/systems/PlayerInputSystem.java +++ b/core/src/com/me/asteroids/systems/PlayerInputSystem.java @@ -31,11 +31,11 @@ public class PlayerInputSystem extends EntitySystem { AccelerationComponent accelComponent = entity.getComponent(AccelerationComponent.class); if (Gdx.input.isKeyPressed(Input.Keys.D)) { - positionComponent.rotation = Utils.rotate(positionComponent.rotation, -5); + positionComponent.rotation = Utils.rotate(positionComponent.rotation, -300 * dt); } if (Gdx.input.isKeyPressed(Input.Keys.A)) { - positionComponent.rotation = Utils.rotate(positionComponent.rotation, 5); + positionComponent.rotation = Utils.rotate(positionComponent.rotation, 300 * dt); } Vector2 acceleration = accelComponent.acceleration;