Exemple #1
0
 def __init__(self,
              ghostAgents,
              display,
              rules,
              layout,
              percentRandomize=0.5):
     Game.__init__(self, ghostAgents, display, rules)
     initState = GameState()
     initState.initialize(layout, len(ghostAgents), percentRandomize)
     self.state = initState
     self.initialState = initState.deepCopy()
Exemple #2
0
 def newGame(self,
             layout,
             pacmanAgent,
             ghostAgents,
             display,
             quiet=False,
             catchExceptions=False):
     from pacman import GameState
     agents = [pacmanAgent] + ghostAgents[:layout.getNumGhosts()]
     initState = GameState()
     initState.initialize(layout, len(ghostAgents))
     game = GameExtended(agents,
                         display,
                         self,
                         catchExceptions=catchExceptions)
     game.state = initState
     self.initialState = initState.deepCopy()
     self.quiet = quiet
     return game