def set_modelScale(self, oldValue): """ Property method. 服务器设置了modelNumber属性 """ DEBUG_MSG("服务器设置了modelScale属性:", oldValue, "改变为", self.modelScale) KBExtra.scaleModel(self.id, self.modelScale)
def onMoveToPoint(self, destination, velocity, faceMovement, moveVertically): """ KBEngine method. 这个entity将要移动到某个点, 由服务器通知 """ KBExtra.moveToPoint(self.id, destination, velocity, faceMovement, moveVertically)
def set_modelYOffset(self, oldValue): """ Property method. 服务器设置了name属性 """ DEBUG_MSG("服务器设置了modelYOffset属性:", oldValue, "改变为", self.modelYOffset) # 通知表现层改变表现 KBExtra.setModelYOffset(self.id, self.modelYOffset)
def set_moveSpeed(self, oldValue): """ Property method. 服务器设置了moveSpeed属性 """ DEBUG_MSG("服务器设置了moveSpeed属性:", oldValue, "改变为", self.moveSpeed) # 设置渲染层entity的速度 KBExtra.setMoveSpeed(self.id, self.moveSpeed)
def set_name(self, oldValue): """ Property method. 服务器设置了name属性 """ DEBUG_MSG("服务器设置了name属性:", oldValue, "改变为", self.name) # 通知表现层改变表现 KBExtra.setEntityName(self.id, self.name)
def enterWorld(self): """ KBEngine method. 这个entity已经进入世界了 """ # 通知APP创建一个entity KBExtra.createEntity(self.id, self.name, tuple(self.position), tuple(self.direction), \ self.modelNumber, self.modelScale, self.moveSpeed, self.modelYOffset, faceToTable[self.modelNumber])
def leaveWorld(self): """ KBEngine method. 这个entity将要离开世界了 """ KBExtra.destroyEntity(self.id)