def __init__(self): self.grid = [] self.mixer = Mixer() self.stats = Statistics() self.curr_piece = random_piece() self.next_piece = random_piece() self.fall_speed = 30 self.time_to_drop = self.fall_speed self.running = False
def new_piece(self): self.curr_piece = self.next_piece self.next_piece = random_piece() if not self.valid_move(self.curr_piece): print "END GAME!" self.end_of_game = True self.set_grid_piece(self.curr_piece)
def new_piece(self): self.curr_piece = self.next_piece self.next_piece = random_piece() if not self.valid_move(self.curr_piece): self.end_game() self.set_grid_piece(self.curr_piece) self.play() # Our playing method
def new_piece(self): self.curr_piece = self.next_piece self.next_piece = random_piece() if not self.valid_move(self.curr_piece): self.end_game() self.set_grid_piece(self.curr_piece)