gameRoomCtrl.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. class gameRoomCtrl{
  2. constructor(){
  3. console.log('gameRoomCtrl初始化');
  4. this.monsters = {}; //-- 当前怪物列表
  5. this.monsterInfo = {}; //-- 剩余怪物
  6. this.obstraceTriggers = {}; //-- 陷阱对象
  7. this.MonsterRoomAttributes = {}; //-- 怪物房间属性加成
  8. this.roomAttribute; //-- 房间陷阱加成
  9. this.ChapterUsedRoomIDs = {}; //-- 已经随机用过的地图ID
  10. this.CurRoomID = 0; //-- 当前房间id
  11. this.EndRoomID = 0; //-- 结束ID
  12. this.RoomMonsterIDs = {}; //-- 房间对应怪物ID的实际怪物ID
  13. this.DropExp = 0;
  14. this.Exp = 0;
  15. this.gameExp = 0; //-- 局内等级经验
  16. this.CutDownTime = 0;
  17. this.CountDownTime = 0; //-- 怪物刷新倒计时
  18. this.RoomStayTime = 0; //-- 单个房间内持续时间
  19. this.UsedMonsterIdIndex = 1; //-- 怪物实例ID索引
  20. this.TotalMonsterWaves = 0; //-- 怪物波数
  21. this.Chapter = 1; //-- 章节
  22. this.StageType = 1; //-- 关卡类型
  23. this.Difficulty = 1; //-- 难度
  24. this.dropGolds = {}; //-- 掉落货币
  25. this.dropItems = {}; //-- 掉落物品特效
  26. this.mapInitMonsterCount = 0; //-- 初始化地图怪物数量
  27. this.delayTime = 0;
  28. this.delayCall = null;
  29. this.dropRes = {}; //-- 单次闯关掉落所有物品
  30. this.DeadTime = 0; //-- 死亡次数
  31. this.mapInited = false; //-- 地图初始化完成
  32. this.inGame = false;
  33. this.nextRoomData = null; //-- 下个房间的信息
  34. this.openBox = false; //-- 是否开宝箱
  35. this.openBoxConten = {}; //--宝箱内容
  36. this.updateTime = 5; //--重启服务器不开门问题
  37. this.hadSendNextTime = false;
  38. }
  39. }
  40. let instance = null;
  41. gameRoomCtrl.getInstance = function(){
  42. if(!instance){
  43. instance = new gameRoomCtrl();
  44. }
  45. return instance;
  46. }
  47. // export default gameRoomCtrl.getInstance();
  48. window.gameRoomCtrl = gameRoomCtrl.getInstance();