add joystick pause
authorstian853 <stian853@su15-112.ad.liu.se>
Mon, 4 Dec 2023 08:56:21 +0000 (09:56 +0100)
committerstian853 <stian853@su15-112.ad.liu.se>
Mon, 4 Dec 2023 08:56:21 +0000 (09:56 +0100)
assets/highscore.csv
src/States.cc

index fa967e13cdf2920ddeed138aae1cc7289547ae81..f5bc58172cc5e163a55f8a4c5e4c7dec2354146c 100644 (file)
@@ -1,5 +1,5 @@
+Gorilla,50
 Gorilla,36
 Gorilla,32
 Gorilla,30
 Gorilla,27
-Gorilla,24
index 7bd05b612937555809e60f98b35d8cbfdadddcee..9c769f6d3a4fed8d722767d475865a86cb9234b5 100644 (file)
@@ -219,6 +219,19 @@ void Game_state::handle_input(sf::Event &event)
 {
     switch (event.type)
     {
+    case sf::Event::JoystickButtonPressed:
+        switch (event.joystickButton.button) 
+        {
+            case 3: // Y
+                pause_game = true;
+                return;
+                break;
+            default:
+                
+                break;
+        }
+        
+        break;
     case sf::Event::KeyPressed:
         switch (event.key.code)
         {