本文整理汇总了Python中toontown.cogdominium.DistCogdoLevelGame.DistCogdoLevelGame类的典型用法代码示例。如果您正苦于以下问题:Python DistCogdoLevelGame类的具体用法?Python DistCogdoLevelGame怎么用?Python DistCogdoLevelGame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DistCogdoLevelGame类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: privGotSpec
def privGotSpec(self, levelSpec):
DistCogdoLevelGame.privGotSpec(self, levelSpec)
levelMgr = self.getEntity(LevelConstants.LevelMgrEntId)
self.endVault = levelMgr.geom
self.endVault.reparentTo(self.geomRoot)
self.endVault.findAllMatches('**/MagnetArms').detach()
self.endVault.findAllMatches('**/Safes').detach()
self.endVault.findAllMatches('**/MagnetControlsAll').detach()
cn = self.endVault.find('**/wallsCollision').node()
cn.setIntoCollideMask(OTPGlobals.WallBitmask | ToontownGlobals.PieBitmask | PM.BitMask32.lowerOn(3) << 21)
walls = self.endVault.find('**/RollUpFrameCillison')
walls.detachNode()
self.evWalls = self.replaceCollisionPolysWithPlanes(walls)
self.evWalls.reparentTo(self.endVault)
self.evWalls.stash()
floor = self.endVault.find('**/EndVaultFloorCollision')
floor.detachNode()
self.evFloor = self.replaceCollisionPolysWithPlanes(floor)
self.evFloor.reparentTo(self.endVault)
self.evFloor.setName('floor')
plane = PM.CollisionPlane(PM.Plane(PM.Vec3(0, 0, 1), PM.Point3(0, 0, -50)))
planeNode = PM.CollisionNode('dropPlane')
planeNode.addSolid(plane)
planeNode.setCollideMask(ToontownGlobals.PieBitmask)
self.geomRoot.attachNewNode(planeNode)
示例2: exitLoaded
def exitLoaded(self):
self.fnp.removeNode()
self.physicsMgr.clearLinearForces()
self.geomRoot.removeNode()
self._gravityForce = None
self._gravityForceNode = None
DistCogdoLevelGame.exitLoaded(self)
示例3: enterGame
def enterGame(self):
DistCogdoLevelGame.enterGame(self)
self._physicsTask = taskMgr.add(self._doPhysics, self.uniqueName('physics'), priority=25)
self.evWalls.stash()
self._startTimer()
if __dev__:
self.accept(self._durationChangedEvent, self._startTimer)
示例4: enterLoaded
def enterLoaded(self):
DistCogdoLevelGame.enterLoaded(self)
self.lightning = loader.loadModel('phase_10/models/cogHQ/CBLightning.bam')
self.magnet = loader.loadModel('phase_10/models/cogHQ/CBMagnet.bam')
self.craneArm = loader.loadModel('phase_10/models/cogHQ/CBCraneArm.bam')
self.controls = loader.loadModel('phase_10/models/cogHQ/CBCraneControls.bam')
self.stick = loader.loadModel('phase_10/models/cogHQ/CBCraneStick.bam')
self.cableTex = self.craneArm.findTexture('MagnetControl')
self.moneyBag = loader.loadModel('phase_10/models/cashbotHQ/MoneyBag')
self.geomRoot = PM.NodePath('geom')
self.sceneRoot = self.geomRoot.attachNewNode('sceneRoot')
self.sceneRoot.setPos(35.84, -115.46, 6.46)
self.physicsMgr = PM.PhysicsManager()
integrator = PM.LinearEulerIntegrator()
self.physicsMgr.attachLinearIntegrator(integrator)
fn = PM.ForceNode('gravity')
self.fnp = self.geomRoot.attachNewNode(fn)
gravity = PM.LinearVectorForce(0, 0, GameConsts.Settings.Gravity.get())
fn.addForce(gravity)
self.physicsMgr.addLinearForce(gravity)
self._gravityForce = gravity
self._gravityForceNode = fn
示例5: disable
def disable(self):
self.timer.destroy()
self.timer = None
DistCogdoLevelGame.disable(self)
return
示例6: announceGenerate
def announceGenerate(self):
DistCogdoLevelGame.announceGenerate(self)
self.timer = ToontownTimer.ToontownTimer()
self.timer.stash()
if __dev__:
self._durationChangedEvent = self.uniqueName('durationChanged')
示例7: __init__
def __init__(self, cr):
DistCogdoLevelGame.__init__(self, cr)
self.cranes = {}
self.moneyBags = {}
示例8: enterFinish
def enterFinish(self):
DistCogdoLevelGame.enterFinish(self)
timeLeft = 10 - (globalClock.getRealTime() - self.getFinishTime())
self.timer.setTime(timeLeft)
self.timer.countdown(timeLeft, self.timerExpired)
self.timer.unstash()
示例9: exitGame
def exitGame(self):
if __dev__:
self.ignore(self._durationChangedEvent)
DistCogdoLevelGame.exitGame(self)
self._physicsTask.remove()
示例10: enterVisible
def enterVisible(self):
DistCogdoLevelGame.enterVisible(self)
self.geomRoot.reparentTo(render)
示例11: enterGame
def enterGame(self):
DistCogdoLevelGame.enterGame(self)
timeLeft = Consts.GameDuration.get() - (globalClock.getRealTime() - self.getStartTime())
self.timer.setTime(timeLeft)
self.timer.countdown(timeLeft, self.timerExpired)
self.timer.unstash()
示例12: announceGenerate
def announceGenerate(self):
DistCogdoLevelGame.announceGenerate(self)
self.timer = ToontownTimer.ToontownTimer()
self.timer.setScale(Consts.Settings.TimerScale.get())
self.timer.stash()
示例13: __init__
def __init__(self, cr):
DistCogdoLevelGame.__init__(self, cr)
示例14: announceGenerate
def announceGenerate(self):
DistCogdoLevelGame.announceGenerate(self)
self.timer = ToontownTimer.ToontownTimer()
self.timer.stash()
示例15: exitGame
def exitGame(self):
DistCogdoLevelGame.exitGame(self)
self._physicsTask.remove()