本文整理汇总了Python中panda3d.core.CollisionHandlerEvent.clear方法的典型用法代码示例。如果您正苦于以下问题:Python CollisionHandlerEvent.clear方法的具体用法?Python CollisionHandlerEvent.clear怎么用?Python CollisionHandlerEvent.clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类panda3d.core.CollisionHandlerEvent
的用法示例。
在下文中一共展示了CollisionHandlerEvent.clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Player
# 需要导入模块: from panda3d.core import CollisionHandlerEvent [as 别名]
# 或者: from panda3d.core.CollisionHandlerEvent import clear [as 别名]
#.........这里部分代码省略.........
if self.jumpInterval is not None:
self.jumpInterval.finish()
self.spear.removeNode()
self.shield.removeNode()
self.player.cleanup()
self.player.removeNode()
self.jumpstartFloater.removeNode()
self.camFloater.removeNode()
#
# BASIC FUNCTIONS
#
def die(self):
self.health -= 1
base.messenger.send("setHealth", [self.health])
self.request("Death")
def heal(self):
if self.health >= 3:
return
self.health += 1
base.messenger.send("setHealth", [self.health])
def hit(self):
self.health -= 1
base.messenger.send("setHealth", [self.health])
if self.health == 0:
self.request("Death")
else:
self.request("Hit")
def resetPlayerPos(self):
self.player.setPos(self.jumpstartFloater.getPos())
self.jumper.clear()
self.request("Idle")
def gameOver(self):
base.messenger.send("GameOver", ["loose"])
def enterFightMode(self, trackedEnemy):
self.trackedEnemy = trackedEnemy
self.mode = Player.FightMode
base.messenger.send("EnterFightMode")
def exitFightMode(self):
self.trackedEnemy = None
self.mode = Player.NormalMode
base.messenger.send("ExitFightMode")
def gamepadLoop(self, task):
joymap = {0: "doAction", 5: "centerCam", 6: "zoomIn", 4: "zoomOut", 9: "escape"}
for event in pygame.event.get():
for button in range(self.mainJoystick.get_numbuttons()):
if button in joymap and self.mainJoystick.get_button(button):
base.messenger.send(joymap[button])
if event.type == pygame.JOYAXISMOTION:
for axis in range(self.mainJoystick.get_numaxes()):
axisChange = 0.0
axisChange = self.mainJoystick.get_axis(axis)
if axis == 0:
self.setKey("horizontal", -axisChange)
if axis == 1:
self.setKey("vertical", axisChange)
return task.cont
def setAnimationSpeed(self, requestedState):