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


Python GravityWalker.disableAvatarControls方法代码示例

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


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

示例1: disableAvatarControls

# 需要导入模块: from direct.controls.GravityWalker import GravityWalker [as 别名]
# 或者: from direct.controls.GravityWalker.GravityWalker import disableAvatarControls [as 别名]
 def disableAvatarControls(self):
     GravityWalker.disableAvatarControls(self)
     self.abortJump()
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:5,代码来源:PiratesGravityWalker.py

示例2: LocalToon

# 需要导入模块: from direct.controls.GravityWalker import GravityWalker [as 别名]
# 或者: from direct.controls.GravityWalker.GravityWalker import disableAvatarControls [as 别名]

#.........这里部分代码省略.........
            animToPlay = None
            timeToWait = 3.0
            if attack not in ('pickpocket', 'fountainpen'):
                suitH = suit.getH(render) % 360
                myH = self.getH(render) % 360
                if -90.0 <= suitH - myH <= 90.0:
                    animToPlay = 'fallFWD'
                else:
                    animToPlay = 'fallBCK'
            elif attack in ('pickpocket',):
                animToPlay = 'cringe'
            elif attack in ('fountainpen',):
                animToPlay = 'conked'
                timeToWait = 5.0
            self.cr.playGame.getPlace().fsm.request('stop')
            self.b_setAnimState(animToPlay)
            base.taskMgr.doMethodLater(timeToWait, self.__attackReactionDone, 'LT.attackReactionDone')
        return

    def __attackReactionDone(self, task):
        self.cr.playGame.hood.loader.place.fsm.request('walk')
        self.b_setAnimState('neutral')
        return Task.done

    def enableAvatarControls(self):
        self.walkControls.enableAvatarControls()
        self.accept('control', self.updateMovementKeymap, ['jump', 1])
        self.accept('control-up', self.updateMovementKeymap, ['jump', 0])
        taskMgr.add(self.movementTask, 'avatarMovementTask')
        self.avatarMovementEnabled = True
        self.playMovementSfx(None)
        return

    def disableAvatarControls(self):
        self.walkControls.disableAvatarControls()
        self.ignore('arrow_up')
        self.ignore('arrow_up-up')
        self.ignore('arrow_down')
        self.ignore('arrow_down-up')
        self.ignore('arrow_left')
        self.ignore('arrow_left-up')
        self.ignore('arrow_right')
        self.ignore('arrow_right-up')
        self.ignore('control')
        self.ignore('control-up')
        taskMgr.remove('avatarMovementTask')
        self.isMoving_forward = False
        self.isMoving_side = False
        self.isMoving_back = False
        self.isMoving_jump = False
        self.avatarMovementEnabled = False
        self.playMovementSfx(None)
        for k, _ in self.movementKeymap.items():
            self.updateMovementKeymap(k, 0)

        return

    def updateMovementKeymap(self, key, value):
        self.movementKeymap[key] = value

    def getMovementKeyValue(self, key):
        return self.movementKeymap[key]

    def playMovementSfx(self, movement):
        if movement == 'run':
            self.walkSfx.stop()
开发者ID:coginvasion,项目名称:src,代码行数:70,代码来源:LocalToon.py


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