aboutsummaryrefslogtreecommitdiff
path: root/src/splitscreen_duo/games/snake.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/splitscreen_duo/games/snake.py')
-rw-r--r--src/splitscreen_duo/games/snake.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/splitscreen_duo/games/snake.py b/src/splitscreen_duo/games/snake.py
index ac624e0..51c0bcc 100644
--- a/src/splitscreen_duo/games/snake.py
+++ b/src/splitscreen_duo/games/snake.py
@@ -100,17 +100,18 @@ class Snake(GameBase):
if not (self.waiting or self.score_display_time):
for event in pygame.event.get():
result = self.handle_common_events(event)
+ action = self.input_handler.get_input(event)
if result is not None:
return result
elif event.type == pygame.KEYDOWN:
- if event.key == pygame.K_UP:
+ if action == "UP":
self.change_to = "UP"
- elif event.key == pygame.K_DOWN:
+ elif action == "DOWN":
self.change_to = "DOWN"
- elif event.key == pygame.K_LEFT:
+ elif action == "LEFT":
self.change_to = "LEFT"
- elif event.key == pygame.K_RIGHT:
+ elif action == "RIGHT":
self.change_to = "RIGHT"
self.check_serial()