Beispiel #1
0
 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
Beispiel #2
0
    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)
Beispiel #3
0
    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
Beispiel #4
0
 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)