コード例 #1
0
ファイル: gamemanager.py プロジェクト: beltsonata/PyPyPy
    def __init__(self, cfgPath, xSize, ySize):
        '''
        @xSize - the intended horizontal video size
        @ySize - the intended vertical video size
        @cfgPath - path to a the config file to use
        '''
        #~ self.name = name
        BasicGame.__init__(self, 'GameManager')
        self.currentWorld = None
        self.currentWorldIndex = 0
        self.gameStartTime = None
        self.gameStarted = False
        self.config = GameConfigParser.parse(cfgPath)
        self.levelOrder = ArrayDeque([
            #~ 'Factory',
            'Test 1',
            # ...
            ])

        self.levelPaths = {
            'Test 1' : LEVEL_DIR + 'ninja_test_1.tmx',
            #~ 'Factory' : LEVEL_DIR + 'Factory_1_R1024x768_T32x32.tmx',
            # ...
        }
        self.checkLevelOrderComposition()
コード例 #2
0
ファイル: diediedie.py プロジェクト: beltsonata/PyPyPy
    def __init__(self, name):
        BasicGame.__init__(self, name)
        self.name = name
        self.currentWorld = None
        self.currentWorldIndex = 0
        self.gameStartTime = None
        self.gameStarted = False

        self.levelOrder = ArrayDeque([
            #~ 'Factory',
            'Ninja Rope Test 1',
            # ...
            ])

        self.levelPaths = {
            'Ninja Rope Test 1' : LEVEL_DIR + 'ninja_test_1.tmx',
            #~ 'Factory' : LEVEL_DIR + 'Factory_1_R1024x768_T32x32.tmx',
            # ...
        }
        self.checkLevelOrderComposition()
コード例 #3
0
ファイル: simulator.py プロジェクト: beltsonata/PyPyPy
 def __init__(
   self, mapName, gravity, worldSize, layers, renderCallable):
     BasicGame.__init__(self, name)
     print 'new WorldSimulator'
     assert (
         isinstance(gravity, int),
         'WorldSimulator : Gravity is not an integer!')
     assert isinstance(worldSize, CWorldSize)
     assert callable(renderCallable)
     self.world = World(Vec2(0, gravity))
     
     # Gravity has a vertical AND a horizontal value 
     self.playerMovement = PlayerMovement()
     self.gravityMan = GravityManager(gravity)
     self.boundsChecker = BoundsChecker(worldSize)
     self._sortLayers(layers)
     self.layerPainter = LayerPainter(
         self.renderLayers, renderCallable)
     self.animPainter = AnimPainter()
     self.imagePainter = ImagePainter()
     self._registerObjects()