From 3b9636bd167b1fabc3487547603204adb51cb19a Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Mon, 19 May 2014 14:05:56 +0900 Subject: [PATCH] Better joystick support --- tetris.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tetris.py b/tetris.py index a6e041f..60e1191 100755 --- a/tetris.py +++ b/tetris.py @@ -401,6 +401,12 @@ class Engine: if event.value > 0: self.game.move_down() elif event.value < 0: self.game.rotate() + elif event.type == pygame.JOYBUTTONDOWN: + if event.button == 7: + self.game.new_game() + elif event.button == 3: + self.game.drop() + return True