Adding next tetrad preview

This commit is contained in:
Alex Yatskov 2014-05-16 20:04:42 +09:00
parent 546498deb6
commit c8969c6f82

View File

@ -167,12 +167,15 @@ class Game:
def new_game(self):
self.board = Board((10, 10), (10, 20), 3, (20, 20))
self.board_prev = Board((300, 300), (4, 4), 3, (20, 20))
self.tetrad = Tetrad.random()
self.tetrad_next = Tetrad.random()
self.counter = 0
def render(self, surface):
self.board.render(surface, self.tetrad)
self.board_prev.render(surface, self.tetrad_next)
def advance(self, elapsed):
@ -202,7 +205,8 @@ class Game:
if not self.try_placement(self.tetrad.moved_down()):
self.board.place_tetrad(self.tetrad)
self.board.settle()
self.tetrad = Tetrad.random()
self.tetrad = self.tetrad_next
self.tetrad_next = Tetrad.random()
def rotate(self):