diff options
author | rcoh <rcoh@mit.edu> | 2011-08-29 15:49:27 -0400 |
---|---|---|
committer | rcoh <rcoh@mit.edu> | 2011-08-29 15:49:27 -0400 |
commit | 507b67d9190697f6324006116784c4e763e969fc (patch) | |
tree | 5a755b33a7bede95330b66949bf21031d67b7a18 | |
parent | ecee8bc8e2820357fca56975300bf73f492b01e6 (diff) | |
parent | f9c82217cbbf4eb2d0f8a901af5cab3c7bad3853 (diff) |
Merge branch 'master' of github.com:rcoh/Burton-Conner-Tetris-Battle
Conflicts:
ddrinput.py
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | ddrinput.py | 7 | ||||
-rw-r--r-- | tetris.py | 1 |
3 files changed, 10 insertions, 2 deletions
@@ -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. diff --git a/ddrinput.py b/ddrinput.py index 4d77ccc..6cad156 100644 --- a/ddrinput.py +++ b/ddrinput.py @@ -1,5 +1,7 @@ import pygame import time +======= + JOY_EVENT = 7 JOY_EVENT_2 = 10 KEY_EVENT = 2 @@ -49,7 +51,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, @@ -218,6 +218,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 |