コード例 #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)
コード例 #2
0
ファイル: Match.py プロジェクト: nddcosta/Columns-Game
 def matches(gamestate) -> bool:
     '''checks if there are any matches'''
     matched_cells = Helper._get_matched_cells(gamestate)
     if not matched_cells:
         return False
     return True
コード例 #3
0
ファイル: Match.py プロジェクト: nddcosta/Columns-Game
 def remove_matches(gamestate) -> None:
     '''removes match attribute for cells'''
     matched_cells = Helper._get_matched_cells(gamestate)
     for cell in matched_cells:
         cell.make_empty_cell()