Ejemplo n.º 1
0
    def nextLevel(self):
        self.audio.passed()
        self.audio.pause()

        self.eatedApples = 0
        self.curLevel += 1

        self.level = Level(self.curLevel)

        if (not self.level.levelExist):
            self.isWin = True
Ejemplo n.º 2
0
    def nextLevel(self):
        # go to the next level
        self.curLevel += 1
        self.level = Level(self.curLevel)

        if not self.level.levelExist:
            self.win()

        # init game elements
        self.player = Player(W // 2 - PLAYER_WIDTH // 2)
        self.balls = [Ball(self.player.rect.center)]
Ejemplo n.º 3
0
    def __init__(self, level=1):
        # init level
        self.level = Level(level)
        self.curLevel = level

        # status variables
        self.isFail = False
        self.isStop = False
        self.isWin = False

        self.boosters = []

        # init game elements
        self.player = Player(W // 2 - PLAYER_WIDTH // 2)
        self.balls = [Ball(self.player.rect.center)]

        self.boardSurf = pygame.Surface(SCREEN)
Ejemplo n.º 4
0
    def restart(self):
        #clear variables
        self.isFail = False
        self.isPause = False
        self.isWin = False

        self.eatedApples = 0

        #first level
        self.curLevel = 1
        self.level = Level(self.curLevel)

        #restart game elements
        self.snake = Snake()
        self.setApple()

        #music controller
        self.audio = Audio()
Ejemplo n.º 5
0
    def __init__(self, curLevel=1):
        #game elements
        self.snake = Snake()
        self.level = Level(curLevel)
        self.setApple()

        self.curLevel = curLevel
        self.eatedApples = 0

        #player loose
        self.isFail = False

        #pause
        self.isPause = False

        #is win game
        self.isWin = False

        #music controller
        self.audio = Audio()