From 6f6b6ceb8a1bca2d7ab08528ddb64f49e71b7283 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sat, 13 Mar 2021 12:34:08 +0100 Subject: Allow to pause the game Signed-off-by: Olivier Gayot --- pycameltris/controller.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pycameltris/controller.py') diff --git a/pycameltris/controller.py b/pycameltris/controller.py index 3532fd9..9878536 100644 --- a/pycameltris/controller.py +++ b/pycameltris/controller.py @@ -20,6 +20,7 @@ class JoystickController: CIRCLE = 1 TRIANGLE = 2 SQUARE = 3 + START = 9 DOWN = 14 LEFT = 15 RIGHT = 16 @@ -32,6 +33,7 @@ class JoystickController: Input.MOVE_LEFT: JoystickController.PS3Controller.LEFT, Input.MOVE_RIGHT: JoystickController.PS3Controller.RIGHT, Input.MOVE_DOWN: JoystickController.PS3Controller.DOWN, + Input.PAUSE: JoystickController.PS3Controller.START, } self.downevent = pygame.JOYBUTTONDOWN self.upevent = pygame.JOYBUTTONUP @@ -65,6 +67,7 @@ class KeyboardController: Input.MOVE_RIGHT: pygame.K_l, Input.MOVE_DOWN: pygame.K_j, Input.QUIT: pygame.K_q, + Input.PAUSE: pygame.K_RETURN, } self.downevent = pygame.KEYDOWN self.upevent = pygame.KEYUP -- cgit v1.2.3