]> git.mcshandy.xyz Git - assteroids/commitdiff
Arrow key support
authorAynRandDuran <lpj1496@gmail.com>
Mon, 12 Jul 2021 16:11:17 +0000 (12:11 -0400)
committerAynRandDuran <lpj1496@gmail.com>
Mon, 12 Jul 2021 16:11:17 +0000 (12:11 -0400)
game.cpp

index ec21e587cb4738f8646b4326ab64fc92f613b14b..4d4d1e881a1c8310de5e59a2e27b42ef151eebc1 100644 (file)
--- 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) {