summaryrefslogtreecommitdiff
path: root/pycameltris/controller.py
diff options
context:
space:
mode:
authorOlivier Gayot <olivier.gayot@sigexec.com>2021-03-13 12:34:08 +0100
committerOlivier Gayot <olivier.gayot@sigexec.com>2021-03-13 16:29:50 +0100
commit6f6b6ceb8a1bca2d7ab08528ddb64f49e71b7283 (patch)
tree4502eb5acb6bd5c313ceae057a9060b7ffed2e84 /pycameltris/controller.py
parent11ed646b1fa625e746a935762ed5ff03f1de05c0 (diff)
Allow to pause the game
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
Diffstat (limited to 'pycameltris/controller.py')
-rw-r--r--pycameltris/controller.py3
1 files changed, 3 insertions, 0 deletions
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