aboutsummaryrefslogtreecommitdiff
path: root/tetris.py
diff options
context:
space:
mode:
authorGravatar rcoh <rcoh@mit.edu>2011-08-29 01:46:55 -0400
committerGravatar rcoh <rcoh@mit.edu>2011-08-29 01:46:55 -0400
commit507ca19df23b4e22fc0261bcc6c1275cd2ceef47 (patch)
treeb75411dffe19d181be9ce91a48ab39593a6fcbb7 /tetris.py
parent37af70803573d93fd2793d5333fc23a9d8f1e4c2 (diff)
some style changes in tetris.
Diffstat (limited to 'tetris.py')
-rw-r--r--tetris.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tetris.py b/tetris.py
index 7851718..5a0b1d6 100644
--- a/tetris.py
+++ b/tetris.py
@@ -25,7 +25,7 @@ LEVEL_SPEEDS = [800,700,600,500,400,300,200,150,100,70]
MAXX = 10
MAXY = 18
-(LEFT, RIGHT, UP, DOWN) = range(4)
+(LEFT, RIGHT, UP, DOWN, DROP, DIE) = range(6)
COLORS = ["orange", "red", "green", "blue", "purple", "yellow", "magenta"]
LEVEL_COLORS = ["red", "orange red", "orange", "yellow",
@@ -263,14 +263,14 @@ class TetrisGame(object):
if ev:
player,direction = ev
#print "Player",player,direction
- if direction == "DIE": #Exit instruction
+ if direction == DIE: #Exit instruction
game_on = False
pygame.quit()
sys.exit()
if self.gameState.state=="playing":
if self.players[player]!=None:
#DROP is only for debugging purposes for now, to make the game end.
- if direction == "DROP":
+ if direction == DROP:
while self.players[player].handle_move( DOWN ):
pass
else: