コード例 #1
0
    def _draw_active_cells(self):
        '''draws active cells and checks for matched/landed cells'''
        active_cells = Helper._get_active_cells(self._state)
        landed_cells = Helper._get_landed_cells(self._state)
        matched_cells = Helper._get_matched_cells(self._state)

        if landed_cells and self._ticks * self._fall_tick_ratio > 1.6:
            self._landed_sound.play()
        if matched_cells and self._ticks * self._fall_tick_ratio > 1.6:
            self._match_sound.play()
            for cell in matched_cells:
                self._score += 10
        for cell in active_cells:
            self._place_cell_in_board(cell)