12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- class gameRoomCtrl{
- constructor(){
- console.log('gameRoomCtrl初始化');
- this.monsters = {}; //-- 当前怪物列表
- this.monsterInfo = {}; //-- 剩余怪物
- this.obstraceTriggers = {}; //-- 陷阱对象
- this.MonsterRoomAttributes = {}; //-- 怪物房间属性加成
- this.roomAttribute; //-- 房间陷阱加成
- this.ChapterUsedRoomIDs = {}; //-- 已经随机用过的地图ID
- this.CurRoomID = 0; //-- 当前房间id
- this.EndRoomID = 0; //-- 结束ID
- this.RoomMonsterIDs = {}; //-- 房间对应怪物ID的实际怪物ID
- this.DropExp = 0;
- this.Exp = 0;
- this.gameExp = 0; //-- 局内等级经验
- this.CutDownTime = 0;
- this.CountDownTime = 0; //-- 怪物刷新倒计时
- this.RoomStayTime = 0; //-- 单个房间内持续时间
- this.UsedMonsterIdIndex = 1; //-- 怪物实例ID索引
- this.TotalMonsterWaves = 0; //-- 怪物波数
- this.Chapter = 1; //-- 章节
- this.StageType = 1; //-- 关卡类型
- this.Difficulty = 1; //-- 难度
- this.dropGolds = {}; //-- 掉落货币
- this.dropItems = {}; //-- 掉落物品特效
- this.mapInitMonsterCount = 0; //-- 初始化地图怪物数量
- this.delayTime = 0;
- this.delayCall = null;
- this.dropRes = {}; //-- 单次闯关掉落所有物品
- this.DeadTime = 0; //-- 死亡次数
- this.mapInited = false; //-- 地图初始化完成
- this.inGame = false;
- this.nextRoomData = null; //-- 下个房间的信息
- this.openBox = false; //-- 是否开宝箱
- this.openBoxConten = {}; //--宝箱内容
- this.updateTime = 5; //--重启服务器不开门问题
- this.hadSendNextTime = false;
- }
- }
- let instance = null;
- gameRoomCtrl.getInstance = function(){
- if(!instance){
- instance = new gameRoomCtrl();
- }
- return instance;
- }
- // export default gameRoomCtrl.getInstance();
- window.gameRoomCtrl = gameRoomCtrl.getInstance();
|