Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mazes = []
- maze = None
- mazeIndex = 0
- def initMazes(self):
- self.mazes.append(# here you create level 1)
- # Set the current maze to level 1
- self.maze = self.mazes[0]
- self.mazes.append(# here you create level 2, and so on)
- def eatSprouts(self):
- self.maze.sprouts -= 1
- if self.maze.sprouts == 0:
- self.mazeIndex += 1
- # Here we check if mazeIndex is equal to len(mazes), in which case there are no more mazes
- if self.mazeIndex == len(mazes):
- print("You win!")
- # Else, if there are more levels, set the next one as the current maze
- else:
- self.maze = self.mazes[self.mazeIndex]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement