From b41719855a8356835c560601198912e1870950a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Sun, 25 Mar 2018 17:57:37 +0200 Subject: [PATCH] Set ship turning correctly. --- src/ship.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ship.c b/src/ship.c index f2fa0b1..5601652 100644 --- a/src/ship.c +++ b/src/ship.c @@ -28,7 +28,7 @@ # define M_PI 3.14159265f #endif -#define ACCEL 5.0f +#define ACCEL 10.0f #define TURN_ACCEL (M_PI / FPS) // turn at pi radians / sec #define SHIP_RADIUS 10.0f // radius of the ship in pixels @@ -54,9 +54,9 @@ void ship_update(struct ship *ship) { ship->velY -= sin(ship->direction) * (ACCEL / 2); } if(key_is_down(KEY_RIGHT)) - ship->direction -= TURN_ACCEL; - if(key_is_down(KEY_LEFT)) ship->direction += TURN_ACCEL; + if(key_is_down(KEY_LEFT)) + ship->direction -= TURN_ACCEL; // keep direction within bounds if(ship->direction >= M_PI * 2)