本文整理匯總了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)