aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar rcoh <rcoh@mit.edu>2011-08-29 15:49:27 -0400
committerGravatar rcoh <rcoh@mit.edu>2011-08-29 15:49:27 -0400
commit507b67d9190697f6324006116784c4e763e969fc (patch)
tree5a755b33a7bede95330b66949bf21031d67b7a18
parentecee8bc8e2820357fca56975300bf73f492b01e6 (diff)
parentf9c82217cbbf4eb2d0f8a901af5cab3c7bad3853 (diff)
Merge branch 'master' of github.com:rcoh/Burton-Conner-Tetris-Battle
Conflicts: ddrinput.py
-rw-r--r--README4
-rw-r--r--ddrinput.py7
-rw-r--r--tetris.py1
3 files changed, 10 insertions, 2 deletions
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.
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,
diff --git a/tetris.py b/tetris.py
index a12ce15..9bab2ad 100644
--- a/tetris.py
+++ b/tetris.py
@@ -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