本文整理汇总了Python中interfaces.NPCObject.NPCObject类的典型用法代码示例。如果您正苦于以下问题:Python NPCObject类的具体用法?Python NPCObject怎么用?Python NPCObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NPCObject类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onTimer
def onTimer(self, tid, userArg):
"""
KBEngine method.
引擎回调timer触发
"""
#DEBUG_MSG("%s::onTimer: %i, tid:%i, arg:%i" % (self.getScriptName(), self.id, tid, userArg))
NPCObject.onTimer(self, tid, userArg)
示例2: __init__
def __init__(self):
KBEngine.Entity.__init__(self)
NPCObject.__init__(self)
GameObject.__init__(self)
DEBUG_MSG("[CellApp] Weapon::__init__: called, attackId: %i" % self.attackId)
self.territoryControllerID = 0
示例3: onStateChanged_
def onStateChanged_(self, oldstate, newstate):
"""
virtual method.
entity状态改变了
"""
State.onStateChanged_(self, oldstate, newstate)
AI.onStateChanged_(self, oldstate, newstate)
NPCObject.onStateChanged_(self, oldstate, newstate)
示例4: __init__
def __init__(self):
NPCObject.__init__(self)
Flags.__init__(self)
State.__init__(self)
Motion.__init__(self)
Combat.__init__(self)
Spell.__init__(self)
AI.__init__(self)
示例5: __init__
def __init__(self):
KBEngine.Entity.__init__(self)
NPCObject.__init__(self)
Flags.__init__(self)
State.__init__(self)
Motion.__init__(self)
Combat.__init__(self)
Spell.__init__(self)
AI.__init__(self)
示例6: __init__
def __init__(self):
KBEngine.Entity.__init__(self)
NPCObject.__init__(self)
Flags.__init__(self)
State.__init__(self)
Motion.__init__(self)
Combat.__init__(self)
Spell.__init__(self)
AI.__init__(self)
if self.modelID == 20002001:
self.layer = 1 # entity所在的层,可以设置多个不同的navmesh层来寻路
示例7: __init__
def __init__(self):
KBEngine.Entity.__init__(self)
NPCObject.__init__(self)
State.__init__(self)
Motion.__init__(self)
Combat.__init__(self)
Spell.__init__(self)
AI.__init__(self)
# entity所在的层,可以设置多个不同的navmesh层来寻路, 这里20002001是warring-demo中在天上的飞龙,
# 第0层是地面,第1层是忽略建筑物的寻路层
if self.modelID == 20002001:
self.layer = 1
示例8: onTimer
def onTimer(self, tid, userArg):
"""
KBEngine method.
引擎回调timer触发
"""
#DEBUG_MSG("%s::onTimer: %i, tid:%i, arg:%i" % (self.getScriptName(), self.id, tid, userArg))
NPCObject.onTimer(self, tid, userArg)
if SCDefine.TIMER_TYPE_HEARDBEAT == userArg:
#DEBUG_MSG("[CellApp] %s::onTimer: %i, position:(%f,%f,%f), velocity(%f, %f, %f)" % (self.getScriptName(), self.id, self.position.x, self.position.y, self.position.z, self.velocity.x, self.velocity.y, self.velocity.z))
if self.velocity != Math.Vector3(0,0,0):
#movePosition = Math.Vector3(self.velocity.x * deltaTime, self.velocity.y * deltaTime, self.velocity.z * deltaTime)
movePosition = self.velocity * deltaTime
self.position = self.position + movePosition
self.velocity.y = self.velocity.y + (-gravity * deltaTime)
if self.position.y < 0:
self.delTimer(tid)
self.destroy()
示例9: onDestroy
def onDestroy(self):
"""
entity销毁
"""
NPCObject.onDestroy(self)
Combat.onDestroy(self)
示例10: __init__
def __init__(self):
NPCObject.__init__(self)
Motion.__init__(self)
示例11: __init__
def __init__(self):
KBEngine.Entity.__init__(self)
NPCObject.__init__(self)
Motion.__init__(self)