コード例 #1
0
    def createSpecs(self):
	Map1 = tmc.getMap(1)
	self.dotSpecs = Map1.getDotSpecifications()
	self.energizerSpecs = Map1.getEnergizerSpecifications()
	self.pacmanSpecs = Map1.getPacmanSpecifications()
	self.ghostSpecs = Map1.getGhostSpecifications()
	self.wallSpecs = Map1.getWallSpecifications()
	self.bonusSpecs = Map1.getBonusItemSpecifications()
コード例 #2
0
	def loadMapSpecs(self, level):
		self.map = MapCoordinator.getMap(level)
		
		if (self.map is not None):
			self.dotSpecifications = self.map.getDotSpecifications()
			self.energizerSpecifications = self.map.getEnergizerSpecifications()
			self.bonusItemSpecifications = self.map.getBonusItemSpecifications()
			self.ghostSpecifications = self.map.getGhostSpecifications()
			self.wallSpecifications = self.map.getWallSpecifications()
			self.pacmanSpecifications = self.map.getPacmanSpecifications()
			
		else:
			print "Fatal error: Map could not be loaded."
			raise SystemExit
コード例 #3
0
    def setUp(self):
	#This test class uses testMapCoordinator, which is the exact same thing as MapCoordinator in maps, except the path is different, because the test files and the files that open pacman are in different locations
	map1 = mc.getMap(1)
	map2 = mc.getMap(2)
	map3 = mc.getMap(3)
	
	#Get specifications for dots, energizers, ghosts, walls and pacman for each map file
        self.dots1 = map1.getDotSpecifications()
        self.energizers1 = map1.getEnergizerSpecifications()
        self.ghosts1 = map1.getGhostSpecifications()
        self.walls1 = map1.getWallSpecifications()
        self.pacman1 = map1.getPacmanSpecifications()
	self.bonus1 = map1.getBonusItemSpecifications()
        self.dots2 = map2.getDotSpecifications()
        self.energizers2 = map2.getEnergizerSpecifications()
        self.ghosts2 = map2.getGhostSpecifications()
        self.walls2 = map2.getWallSpecifications()
        self.pacman2 = map2.getPacmanSpecifications()
        self.dots3 = map3.getDotSpecifications()
        self.energizers3 = map3.getEnergizerSpecifications()
        self.ghosts3 = map3.getGhostSpecifications()
        self.walls3 = map3.getWallSpecifications()
        self.pacman3 = map3.getPacmanSpecifications()