예제 #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
예제 #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)
예제 #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
예제 #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)