|
4 | 4 | # pylint: disable=too-many-branches, too-many-statements
|
5 | 5 | from random import randint
|
6 | 6 | import pygame
|
7 |
| -from pygame.locals import * # pylint: disable=unused-wildcard-import |
| 7 | +from pygame.locals import * # pylint: disable=wildcard-import, unused-wildcard-import |
8 | 8 | from pygame.time import delay
|
9 | 9 | from sprites import Tree, Board, Element
|
10 | 10 | from sounds import Sounds, play_sound
|
@@ -340,7 +340,7 @@ def swap(self, spritegroup):
|
340 | 340 | pygame.display.flip()
|
341 | 341 |
|
342 | 342 | self.swap_values()
|
343 |
| - if self.eliminate_animal(): |
| 343 | + if self.eliminate_animals(): |
344 | 344 | self.step -= 1
|
345 | 345 | else:
|
346 | 346 | self.swap_values()
|
@@ -476,7 +476,8 @@ def change_down(self, i, j, num):
|
476 | 476 | for k in range(0, num):
|
477 | 477 | self.animal[i+k][j] = -2
|
478 | 478 |
|
479 |
| - def eliminate_animal(self): |
| 479 | + def eliminate_animals(self): |
| 480 | + '''Eliminate the animals.''' |
480 | 481 | score_level = self.score
|
481 | 482 | self.value_swapped = False
|
482 | 483 | for i in range(self.row, self.row + self.height):
|
@@ -710,11 +711,11 @@ def fall_animal(self): # pylint: disable=too-many-locals
|
710 | 711 | speed = animal_sprite.speed
|
711 | 712 | pygame.display.flip()
|
712 | 713 |
|
713 |
| - def judge_next(self, type, score): |
| 714 | + def judge_next(self, tp, score): |
714 | 715 | '''Check whether the next level is reached or not'''
|
715 |
| - if type == 1: # Passed |
| 716 | + if tp == 1: # Passed |
716 | 717 | self.load_fns_window(score)
|
717 |
| - elif type == -1: # Failed |
| 718 | + elif tp == -1: # Failed |
718 | 719 | self.load_fail_window()
|
719 | 720 |
|
720 | 721 | def load_fail_window(self):
|
|
0 commit comments