当前位置: 首页>>代码示例>>Python>>正文


Python OrthoWalk.enter方法代码示例

本文整理汇总了Python中toontown.minigame.OrthoWalk.OrthoWalk.enter方法的典型用法代码示例。如果您正苦于以下问题:Python OrthoWalk.enter方法的具体用法?Python OrthoWalk.enter怎么用?Python OrthoWalk.enter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在toontown.minigame.OrthoWalk.OrthoWalk的用法示例。


在下文中一共展示了OrthoWalk.enter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: DistributedCogThiefGame

# 需要导入模块: from toontown.minigame.OrthoWalk import OrthoWalk [as 别名]
# 或者: from toontown.minigame.OrthoWalk.OrthoWalk import enter [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()
#.........这里部分代码省略.........
开发者ID:ponyboy837,项目名称:Toontown-2003-Server,代码行数:103,代码来源:DistributedCogThiefGame.py

示例2: DistributedCogThiefGame

# 需要导入模块: from toontown.minigame.OrthoWalk import OrthoWalk [as 别名]
# 或者: from toontown.minigame.OrthoWalk.OrthoWalk import enter [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
#.........这里部分代码省略.........
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leaked-Source,代码行数:103,代码来源:DistributedCogThiefGame.py


注:本文中的toontown.minigame.OrthoWalk.OrthoWalk.enter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。