From: stian853 Date: Mon, 4 Dec 2023 08:56:21 +0000 (+0100) Subject: add joystick pause X-Git-Url: https://gitweb.forssennils.se/?a=commitdiff_plain;h=2b291010c4dca2ce7e68793cda373a96595e557f;p=TDDC76_proj.git add joystick pause --- 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) {