diff options
-rw-r--r-- | ddrinput.py | 6 | ||||
-rw-r--r-- | tetris.py | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/ddrinput.py b/ddrinput.py index a1bf482..19966d8 100644 --- a/ddrinput.py +++ b/ddrinput.py @@ -1,4 +1,5 @@ import pygame + JOY_EVENT = 7 KEY_EVENT = 2 X = 0 @@ -45,7 +46,10 @@ class DdrInput(object): for i in range(totaljoy): m = pygame.joystick.Joystick(i) m.init() - + + def reset(self): + pygame.event.clear() + def poll(self): """ Returns a tuple of player index (0 or 1) and move, @@ -217,6 +217,7 @@ class TetrisGame(object): self.board_animation(0,"up_arrow") self.board_animation(1,"up_arrow") self.start_time = None + self.input.reset() self.update_gui() self.handle_input() #this calls all other functions, such as add_player, start_game |