示例#1
0
    def onTimer(self, tid, userArg):
        """
		KBEngine method.
		引擎回调timer触发
		"""
        #DEBUG_MSG("%s::onTimer: %i, tid:%i, arg:%i" % (self.className, self.id, tid, userArg))
        EntityCommon.onTimer(self, tid, userArg)
示例#2
0
    def __init__(self):
        KBEngine.Entity.__init__(self)
        EntityCommon.__init__(self)

        # 设置每秒允许的最快速度, 超速会被拉回去
        #self.topSpeed = self.moveSpeed + 0.5
        self.topSpeed = 0.0

        # 默认开始的尺寸
        self.modelRadius = 0.5

        # 默认开始大小
        self.defaultMass = self.mass

        # 随机的初始化一个出生位置
        #self.position = GameUtils.randomPosition3D(self.modelRadius)
        self.position = GameUtils.randomPosition3DByRange(100, 100, 0, 20)

        # self.topSpeedY = 10.0
        self.getCurrRoom().onEnter(self)

        # 可视范围起始位30米,后期根据长大尺寸调整
        self.setAoiRadius(30.0, 1.0)

        self.addTimer(0.1, 0, TIMER_TYPE_ADD_TRAP)
示例#3
0
	def __init__(self):
		KBEngine.Entity.__init__(self)
		EntityCommon.__init__(self)
		# 让baseapp和cellapp都能够方便的访问到这个房间的entityCall
		KBEngine.globalData["Room_%i" % self.spaceID] = self.base
		DEBUG_MSG("cell Room init roomIDC = {}".format(self.roomIDC))
		DEBUG_MSG("cell Room init gameTypeC = {}".format(self.gameTypeC))
		DEBUG_MSG("cell Room init roomParamsC = {}".format(self.roomParamsC))
		# 设置cell默认属性, 由base传递过来
		self.init_from_dict(self.roomParamsC)

		# 房间的一些通用属性
		# 状态0: 未开始游戏, 1: 某一局游戏中
		self.state = const.ROOM_WAITING
		# 存放该房间内的玩家mailbox
		self.avatars = {}
		self.players_list = [None] * self.player_num
		self.origin_players_list = [None] * self.player_num

		# 牌局记录
		self.game_result = {}
		# 增加房间销毁定时器
		self.timeout_timer = self.add_timer(const.ROOM_TTL, self.timeoutDestroy)
		# 解散房间秒数
		self.dismissRoomSecends = const.DISMISS_ROOM_WAIT_TIME
		# 解散房间同意人数
		self.dismissRoomAgreeNum = 4
示例#4
0
 def __init__(self):
     KBEngine.Entity.__init__(self)
     EntityCommon.__init__(self)
     self.startPosition = copy.deepcopy(self.position)
     self.getCurrRoom().onEnter(self)
     DEBUG_MSG(
         "new avatar cell: id=%i accountName=%s  avatarName=%s spaceID=%i" %
         (self.id, self.accountName, self.avatarName, self.spaceID))
示例#5
0
    def __init__(self):

        KBEngine.Entity.__init__(self)
        EntityCommon.__init__(self)

        self.position = (self.cid, 0.0, 0.0)

        self.getCurrRoom().onEnter(self)
示例#6
0
    def __init__(self):
        KBEngine.Entity.__init__(self)
        EntityCommon.__init__(self)

        #self.handCards = []
        #self.handCardsCount = 0
        #self.playCards = []

        self.getCurrRoom().onEnter(self)
示例#7
0
	def onTimer(self, tid, userArg):
		"""
		KBEngine method.
		引擎回调timer触发
		"""
		#DEBUG_MSG("%s::onTimer: %i, tid:%i, arg:%i" % (self.className, self.id, tid, userArg))
		EntityCommon.onTimer(self, tid, userArg)

		if TIMER_TYPE_ADD_TRAP == userArg:
			self.addProximity(self.modelRadius, 0, 0)
示例#8
0
    def __init__(self):

        DEBUG_MSG("Player.Cell __init__")

        KBEngine.Entity.__init__(self)
        EntityCommon.__init__(self)

        self.position = (self.cid, 0.0, 0.0)

        self.getCurrRoom().onEnter(self)
示例#9
0
文件: Avatar.py 项目: lin5/stone_war
 def __init__(self):
     KBEngine.Entity.__init__(self)
     EntityCommon.__init__(self)
     DEBUG_MSG("Avatar %i cell new" % (self.id))
     DEBUG_MSG(self.position)
     self.startPosition = copy.deepcopy(self.position)
     self.getCurrRoom().onEnter(self)
     DEBUG_MSG(
         "new avatar cell: id=%i accountName=%s nickName=%s avatarName=%s" %
         (self.id, self.accountName, self.nickName, self.avatarName))
示例#10
0
    def __init__(self):
        KBEngine.Entity.__init__(self)
        EntityCommon.__init__(self)

        # 设置每秒允许的最快速度, 超速会被拉回去
        #self.topSpeed = self.moveSpeed + 0.5
        self.topSpeed = 0.0

        # 随机的初始化一个出生位置
        #		self.position = GameUtils.randomPosition3D(self.modelRadius)

        # self.topSpeedY = 10.0
        self.getCurrRoom().onEnter(self)
示例#11
0
文件: Avatar.py 项目: shacleff/PaSan
    def __init__(self):
        KBEngine.Entity.__init__(self)
        EntityCommon.__init__(self)
        iRoomOperation.__init__(self)
        iRoomOperationPS.__init__(self)
        # 设置cell默认属性, 由base传递过来
        self.init_from_dict(self.userInfo)

        # witness callback
        self.witness_request = []

        # Attention: 这个需要放在最后, onEnter会初始化适配器
        self.room = self.getCurrRoom()
        self.room.onEnter(self)
示例#12
0
	def __init__(self):
		KBEngine.Entity.__init__(self)
		EntityCommon.__init__(self)
示例#13
0
	def __init__(self):
		KBEngine.Entity.__init__(self)
		EntityCommon.__init__(self)

		DEBUG_MSG("Avatar::__init__:%s." % (self.__dict__))
	def __init__(self):
		KBEngine.Entity.__init__(self)
		EntityCommon.__init__(self)

		# 随机的初始化一个出生位置
		self.position = GameUtils.randomPosition3D(self.modelRadius)
示例#15
0
    def __init__(self):
        KBEngine.Entity.__init__(self)
        EntityCommon.__init__(self)

        self.addTimer(0.1, 0, TIMER_TYPE_ADD_TRAP)