From d75d04ad031f63972098f59f86cc13aae42953ab Mon Sep 17 00:00:00 2001 From: AynRandDuran Date: Mon, 12 Jul 2021 12:11:17 -0400 Subject: [PATCH] Arrow key support --- game.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/game.cpp b/game.cpp index ec21e58..4d4d1e8 100644 --- a/game.cpp +++ b/game.cpp @@ -192,13 +192,13 @@ int main(void) { BeginDrawing(); ClearBackground(Space); - if(IsKeyDown('J') && ship_alive) { + if((IsKeyDown('J') || IsKeyDown(KEY_LEFT)) && ship_alive) { spin_ship(-4); } - if(IsKeyDown('L') && ship_alive) { + if((IsKeyDown('L') || IsKeyDown(KEY_RIGHT)) && ship_alive) { spin_ship(4); } - if(IsKeyPressed('I') && ship_alive) { + if((IsKeyPressed('I') || IsKeyPressed(KEY_UP)) && ship_alive) { throttle = true; } if(IsKeyPressed('S') && ship_alive) { @@ -285,13 +285,11 @@ void enable_shield() { shield_hp = 9; active_powerups |= GOD; time(&shield_spawn_time); - printf("powerups: %d\n", active_powerups); } void disable_shield() { active_powerups ^= GOD; shield_hp = 9; - printf("powerups: %d\n", active_powerups); } void explode_asteroid(Vector4* astr) { -- 2.49.0