From 2b291010c4dca2ce7e68793cda373a96595e557f Mon Sep 17 00:00:00 2001 From: stian853 Date: Mon, 4 Dec 2023 09:56:21 +0100 Subject: [PATCH] add joystick pause --- assets/highscore.csv | 2 +- src/States.cc | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/assets/highscore.csv b/assets/highscore.csv index fa967e1..f5bc581 100644 --- a/assets/highscore.csv +++ b/assets/highscore.csv @@ -1,5 +1,5 @@ +Gorilla,50 Gorilla,36 Gorilla,32 Gorilla,30 Gorilla,27 -Gorilla,24 diff --git a/src/States.cc b/src/States.cc index 7bd05b6..9c769f6 100644 --- a/src/States.cc +++ b/src/States.cc @@ -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) { -- 2.30.2