本文整理汇总了Python中toontown.minigame.OrthoWalk.OrthoWalk.exit方法的典型用法代码示例。如果您正苦于以下问题:Python OrthoWalk.exit方法的具体用法?Python OrthoWalk.exit怎么用?Python OrthoWalk.exit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.minigame.OrthoWalk.OrthoWalk
的用法示例。
在下文中一共展示了OrthoWalk.exit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DistributedCogThiefGame
# 需要导入模块: from toontown.minigame.OrthoWalk import OrthoWalk [as 别名]
# 或者: from toontown.minigame.OrthoWalk.OrthoWalk import exit [as 别名]
class DistributedCogThiefGame(DistributedMinigame):
notify = directNotify.newCategory("DistributedCogThiefGame")
ToonSpeed = CTGG.ToonSpeed
StageHalfWidth = 200.0
StageHalfHeight = 100.0
BarrelScale = 0.25
TOON_Z = 0
UPDATE_SUITS_TASK = "CogThiefGameUpdateSuitsTask"
REWARD_COUNTDOWN_TASK = "cogThiefGameRewardCountdown"
ControlKeyLimitTime = 1.0
def __init__(self, cr):
DistributedMinigame.__init__(self, cr)
self.gameFSM = ClassicFSM.ClassicFSM(
"DistributedCogThiefGame",
[
State.State("off", self.enterOff, self.exitOff, ["play"]),
State.State("play", self.enterPlay, self.exitPlay, ["cleanup"]),
State.State("cleanup", self.enterCleanup, self.exitCleanup, []),
],
"off",
"cleanup",
)
self.addChildGameFSM(self.gameFSM)
self.cameraTopView = (0, 0, 55, 0, -90.0, 0)
self.barrels = []
self.cogInfo = {}
self.lastTimeControlPressed = 0
self.stolenBarrels = []
self.useOrthoWalk = base.config.GetBool("cog-thief-ortho", 1)
self.resultIval = None
self.gameIsEnding = False
self._DistributedCogThiefGame__textGen = TextNode("cogThiefGame")
self._DistributedCogThiefGame__textGen.setFont(ToontownGlobals.getSignFont())
self._DistributedCogThiefGame__textGen.setAlign(TextNode.ACenter)
def getTitle(self):
return TTLocalizer.CogThiefGameTitle
def getInstructions(self):
return TTLocalizer.CogThiefGameInstructions
def getMaxDuration(self):
return 0
def load(self):
self.notify.debug("load")
DistributedMinigame.load(self)
self.music = base.loadMusic("phase_4/audio/bgm/MG_CogThief.mid")
self.initCogInfo()
for barrelIndex in range(CTGG.NumBarrels):
barrel = loader.loadModel("phase_4/models/minigames/cogthief_game_gagTank")
barrel.setPos(CTGG.BarrelStartingPositions[barrelIndex])
barrel.setScale(self.BarrelScale)
barrel.reparentTo(render)
barrel.setTag("barrelIndex", str(barrelIndex))
collSphere = CollisionSphere(0, 0, 0, 4)
collSphere.setTangible(0)
name = "BarrelSphere-%d" % barrelIndex
collSphereName = self.uniqueName(name)
collNode = CollisionNode(collSphereName)
collNode.setFromCollideMask(CTGG.BarrelBitmask)
collNode.addSolid(collSphere)
colNp = barrel.attachNewNode(collNode)
handler = CollisionHandlerEvent()
handler.setInPattern("barrelHit-%fn")
base.cTrav.addCollider(colNp, handler)
self.accept("barrelHit-" + collSphereName, self.handleEnterBarrel)
nodeToHide = "**/gagMoneyTen"
if barrelIndex % 2:
nodeToHide = "**/gagMoneyFive"
iconToHide = barrel.find(nodeToHide)
if not iconToHide.isEmpty():
iconToHide.hide()
self.barrels.append(barrel)
self.gameBoard = loader.loadModel("phase_4/models/minigames/cogthief_game")
self.gameBoard.find("**/floor_TT").hide()
self.gameBoard.find("**/floor_DD").hide()
self.gameBoard.find("**/floor_DG").hide()
self.gameBoard.find("**/floor_MM").hide()
self.gameBoard.find("**/floor_BR").hide()
self.gameBoard.find("**/floor_DL").hide()
zone = self.getSafezoneId()
if zone == ToontownGlobals.ToontownCentral:
self.gameBoard.find("**/floor_TT").show()
elif zone == ToontownGlobals.DonaldsDock:
self.gameBoard.find("**/floor_DD").show()
elif zone == ToontownGlobals.DaisyGardens:
self.gameBoard.find("**/floor_DG").show()
elif zone == ToontownGlobals.MinniesMelodyland:
self.gameBoard.find("**/floor_MM").show()
elif zone == ToontownGlobals.TheBrrrgh:
self.gameBoard.find("**/floor_BR").show()
elif zone == ToontownGlobals.DonaldsDreamland:
self.gameBoard.find("**/floor_DL").show()
else:
self.gameBoard.find("**/floor_TT").show()
#.........这里部分代码省略.........
示例2: DistributedCogThiefGame
# 需要导入模块: from toontown.minigame.OrthoWalk import OrthoWalk [as 别名]
# 或者: from toontown.minigame.OrthoWalk.OrthoWalk import exit [as 别名]
class DistributedCogThiefGame(DistributedMinigame):
notify = directNotify.newCategory('DistributedCogThiefGame')
ToonSpeed = CTGG.ToonSpeed
StageHalfWidth = 200.0
StageHalfHeight = 100.0
BarrelScale = 0.3
TOON_Z = 0
UPDATE_SUITS_TASK = 'CogThiefGameUpdateSuitsTask'
REWARD_COUNTDOWN_TASK = 'cogThiefGameRewardCountdown'
ControlKeyLimitTime = 1.0
def __init__(self, cr):
DistributedMinigame.__init__(self, cr)
self.gameFSM = ClassicFSM.ClassicFSM('DistributedCogThiefGame', [State.State('off', self.enterOff, self.exitOff, ['play']), State.State('play', self.enterPlay, self.exitPlay, ['cleanup']), State.State('cleanup', self.enterCleanup, self.exitCleanup, [])], 'off', 'cleanup')
self.addChildGameFSM(self.gameFSM)
toon = base.localAvatar
camera.reparentTo(toon)
camera.setPos(0,-15,5)
camera.setHpr(0, -5, 0)
self.barrels = []
self.cogInfo = {}
self.lastTimeControlPressed = 0
self.stolenBarrels = []
self.useOrthoWalk = config.GetBool('cog-thief-ortho', 0)
self.resultIval = None
self.gameIsEnding = False
self.__textGen = TextNode('cogThiefGame')
self.__textGen.setFont(ToontownGlobals.getSignFont())
self.__textGen.setAlign(TextNode.ACenter)
return
def getTitle(self):
return TTLocalizer.CogThiefGameTitle
def getInstructions(self):
return TTLocalizer.CogThiefGameInstructions
def getMaxDuration(self):
return 0
def load(self):
self.notify.debug('load')
DistributedMinigame.load(self)
self.music = base.loadMusic('phase_4/audio/bgm/MG_CogThief.ogg')
self.initCogInfo()
for barrelIndex in range(CTGG.NumBarrels):
barrel = loader.loadModel('phase_4/models/minigames/cogthief_game_gagTank')
barrel.setPos(CTGG.BarrelStartingPositions[barrelIndex])
barrel.setScale(self.BarrelScale)
barrel.reparentTo(render)
barrel.setTag('barrelIndex', str(barrelIndex))
collSphere = CollisionSphere(0, 0, 0, 4)
collSphere.setTangible(0)
name = 'BarrelSphere-%d' % barrelIndex
collSphereName = self.uniqueName(name)
collNode = CollisionNode(collSphereName)
collNode.setFromCollideMask(CTGG.BarrelBitmask)
collNode.addSolid(collSphere)
colNp = barrel.attachNewNode(collNode)
handler = CollisionHandlerEvent()
handler.setInPattern('barrelHit-%fn')
base.cTrav.addCollider(colNp, handler)
self.accept('barrelHit-' + collSphereName, self.handleEnterBarrel)
nodeToHide = '**/gagMoneyTen'
if barrelIndex % 2:
nodeToHide = '**/gagMoneyFive'
iconToHide = barrel.find(nodeToHide)
if not iconToHide.isEmpty():
iconToHide.hide()
self.barrels.append(barrel)
self.gameBoard = loader.loadModel('phase_8/models/minigames/tag_arena_DG')
self.sky = loader.loadModel('phase_3.5/models/props/TT_sky')
#self.gameBoard.find('**/floor_TT').hide()
#self.gameBoard.find('**/floor_DD').hide()
#self.gameBoard.find('**/floor_DG').hide()
#self.gameBoard.find('**/floor_MM').hide()
#self.gameBoard.find('**/floor_BR').hide()
#self.gameBoard.find('**/floor_DL').hide()
#zone = self.getSafezoneId()
#if zone == ToontownGlobals.ToontownCentral:
# self.gameBoard.find('**/floor_TT').show()
#elif zone == ToontownGlobals.DonaldsDock:
# self.gameBoard.find('**/floor_DD').show()
#elif zone == ToontownGlobals.DaisyGardens:
# self.gameBoard.find('**/floor_DG').show()
#elif zone == ToontownGlobals.MinniesMelodyland:
# self.gameBoard.find('**/floor_MM').show()
#elif zone == ToontownGlobals.TheBrrrgh:
# self.gameBoard.find('**/floor_BR').show()
#elif zone == ToontownGlobals.DonaldsDreamland:
# self.gameBoard.find('**/floor_DL').show()
#else:
# self.gameBoard.find('**/floor_TT').show()
self.gameBoard.setPosHpr(0, 0, 0, 0, 0, 0)
self.gameBoard.setScale(1.0)
self.sky.setPosHpr(0, 0, -47, 0, 0, 0)
self.sky.setScale(1.0)
self.toonSDs = {}
avId = self.localAvId
#.........这里部分代码省略.........