Exemplo n.º 1
0
 def installWorldBall(self, context, myWorldBall, loadBall=None ):
     #print myWorldBall
     self.worldArray = []
     if context == 'editor':
         for mB in myWorldBall[0]:
             self.worldArray.append( generalmap.edMap(mB) )
         self.initialMap = self.getMapByName( myWorldBall[1] )
         self.currentMap = self.getMapByName( myWorldBall[1] )
     elif context == 'game':
         for mB in myWorldBall[0]:
             #print mB
             self.worldArray.append( generalmap.gameMap(mB, None) )
         if loadBall is not None:
             for mB in loadBall[0]:
                 newMap = generalmap.gameMap(mB)
                 self.worldArray.append( newMap )
                 if newMap.up[0] != 'dungeon':
                     self.getMapByName(newMap.up[0]).down = ( newMap.getName(), )
                 if newMap.down[0] != 'dungeon':
                     self.getMapByName(newMap.down[0]).up = ( newMap.getName(), )
             self.initialMap = self.getMapByName( loadBall[1] )
             self.currentMap = self.getMapByName( loadBall[2] )
         else:
             self.initialMap = self.getMapByName( myWorldBall[1] )
             self.currentMap = self.getMapByName( myWorldBall[2] )
Exemplo n.º 2
0
 def generateMap(self, dimension, level, type):
     if type == 'dungeon':
         MG = mapgen.Generator(dimension, level)
         MG.generateMap(20)
         newMap = generalmap.gameMap(MG.getMapBall(), level)
     elif type == 'maze':
         MG = mazegen.Generator(dimension, level)
         MG.generateMap()
         newMap = generalmap.gameMap(self.inputHandler, None, MG.getMapBall(), level=self.levelDepth)
     return newMap