diff options
author | rcoh <rcoh@mit.edu> | 2011-08-29 01:57:43 -0400 |
---|---|---|
committer | rcoh <rcoh@mit.edu> | 2011-08-29 01:57:43 -0400 |
commit | caad42bb405cb51b1fe7a66c2ca854c2d90ee85d (patch) | |
tree | a63426ba5b158a30713843305e571950f8e35135 /tetris.py | |
parent | 507ca19df23b4e22fc0261bcc6c1275cd2ceef47 (diff) | |
parent | a62926dd1e304cd75066811425de108f340926f6 (diff) |
Merge branch 'master' of github.com:rcoh/Burton-Conner-Tetris-Battle
Conflicts:
renderer.py
Diffstat (limited to 'tetris.py')
-rw-r--r-- | tetris.py | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -20,16 +20,15 @@ from ddrinput import DIRECTIONS import pygame TIME_LIMIT = 4 * 60 #seconds -LINES_TO_ADVANCE = 5 #num lines needed to advance to next level -LEVEL_SPEEDS = [800,700,600,500,400,300,200,150,100,70] +LINES_TO_ADVANCE = 8 #num lines needed to advance to next level +LEVEL_SPEEDS = [700,550,400,250,150,110] MAXX = 10 MAXY = 18 (LEFT, RIGHT, UP, DOWN, DROP, DIE) = range(6) COLORS = ["orange", "red", "green", "blue", "purple", "yellow", "magenta"] -LEVEL_COLORS = ["red", "orange red", "orange", "yellow", - "green yellow", "green", "turquoise", "blue", "blue violet", "purple"] +LEVEL_COLORS = ["red", "orange", "yellow", "green", "blue", "purple"] class Board(): """ @@ -120,13 +119,14 @@ class Board(): That is; if there is a 'landed' block there or it is outside the board boundary, then return False, otherwise return true. """ - if x < 0 or x >= self.max_x or y < 0 or y >= self.max_y: + if x < 0 or x >= self.max_x or y < -3 or y >= self.max_y: return False elif self.landed.has_key( (x, y) ): return False else: return True + #represents a player. each player has a board, other player's board, #current shape, score, etc class Player(): @@ -330,8 +330,7 @@ class TetrisGame(object): else: self.board_animation(winner_board,"outline","yellow") self.update_gui() - for i in range(250): - print i, + sleep(3) def create_shapes(self,design): #in progress..... shapes = {} @@ -374,7 +373,8 @@ class TetrisGame(object): if p.shape: blocks = p.shape.blocks for b in blocks: - d[(b.x+offset*n,b.y)] = b.color + if b.y >= 0: + d[(b.x+offset*n,b.y)] = b.color #score score = p.score |