From 2dc75afd2c6b01a9d9aa419234157330d8eb172f Mon Sep 17 00:00:00 2001 From: Leah Alpert Date: Sun, 28 Aug 2011 23:33:55 -0700 Subject: Reset input queue at start of each game --- ddrinput.py | 6 +++++- tetris.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) 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, diff --git a/tetris.py b/tetris.py index fd67ae2..64b3eed 100644 --- a/tetris.py +++ b/tetris.py @@ -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 -- cgit v1.2.3 From f9c82217cbbf4eb2d0f8a901af5cab3c7bad3853 Mon Sep 17 00:00:00 2001 From: lalpert Date: Mon, 29 Aug 2011 03:19:32 -0700 Subject: Edited README via GitHub --- README | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README b/README index 081251c..f670ba6 100644 --- a/README +++ b/README @@ -8,8 +8,10 @@ Once all players have joined, press DOWN to start the game Use LEFT and RIGHT to move your shape, UP to rotate, and DOWN to make it drop faster When you complete a line it will disappear from the board and you gain one point. Your score is displayed in binary below your board. If you clear two or more lines at once, n-1 incomplete lines will appear at the bottom of your opponent�s board. +The blocks drop faster as players clear more lines. There are 6 possible levels + When one player�s board reaches the top of the screen, they lose and the other player wins. -If neither player loses after 3 minutes, the player with the higher score wins. +If neither player loses after 4 minutes, the player with the higher score wins. Press ESC to exit the program. -- cgit v1.2.3