Просмотр исходного кода

Merge branch 'master' of http://git.mokasz.com/zouyong/mk_framework

zouyong 5 лет назад
Родитель
Сommit
9f6303ef7f

BIN
assets/res/game/ui/game/bg.png


+ 9 - 9
assets/res/game/ui/game/bg.png.meta

@@ -1,20 +1,20 @@
 {
   "ver": "2.3.5",
-  "uuid": "4d577a6a-1356-49c0-b25a-8f359f00a883",
+  "uuid": "c2173721-63b6-442f-9ae5-dba9fc4979d5",
   "type": "sprite",
   "wrapMode": "clamp",
   "filterMode": "bilinear",
   "premultiplyAlpha": false,
   "genMipmaps": false,
   "packable": true,
-  "width": 706,
-  "height": 706,
+  "width": 750,
+  "height": 1700,
   "platformSettings": {},
   "subMetas": {
     "bg": {
       "ver": "1.0.4",
-      "uuid": "1a2f437a-b8a2-4189-b3e6-7c4388369d6c",
-      "rawTextureUuid": "4d577a6a-1356-49c0-b25a-8f359f00a883",
+      "uuid": "a9d06103-168c-4add-8352-0ed57f2c954e",
+      "rawTextureUuid": "c2173721-63b6-442f-9ae5-dba9fc4979d5",
       "trimType": "auto",
       "trimThreshold": 1,
       "rotated": false,
@@ -22,10 +22,10 @@
       "offsetY": 0,
       "trimX": 0,
       "trimY": 0,
-      "width": 706,
-      "height": 706,
-      "rawWidth": 706,
-      "rawHeight": 706,
+      "width": 750,
+      "height": 1700,
+      "rawWidth": 750,
+      "rawHeight": 1700,
       "borderTop": 0,
       "borderBottom": 0,
       "borderLeft": 0,

BIN
assets/res/game/ui/game/bg_cell.png


+ 0 - 36
assets/res/game/ui/game/bg_cell.png.meta

@@ -1,36 +0,0 @@
-{
-  "ver": "2.3.5",
-  "uuid": "01d22575-0b96-4920-996d-1a8cc6d8462d",
-  "type": "sprite",
-  "wrapMode": "clamp",
-  "filterMode": "bilinear",
-  "premultiplyAlpha": false,
-  "genMipmaps": false,
-  "packable": true,
-  "width": 80,
-  "height": 80,
-  "platformSettings": {},
-  "subMetas": {
-    "bg_cell": {
-      "ver": "1.0.4",
-      "uuid": "88f501ff-4744-46e4-aa3f-324e8c537a58",
-      "rawTextureUuid": "01d22575-0b96-4920-996d-1a8cc6d8462d",
-      "trimType": "auto",
-      "trimThreshold": 1,
-      "rotated": false,
-      "offsetX": 0,
-      "offsetY": 0,
-      "trimX": 0,
-      "trimY": 0,
-      "width": 80,
-      "height": 80,
-      "rawWidth": 80,
-      "rawHeight": 80,
-      "borderTop": 10,
-      "borderBottom": 10,
-      "borderLeft": 10,
-      "borderRight": 10,
-      "subMetas": {}
-    }
-  }
-}

BIN
assets/res/game/ui/game/bg_game.png


+ 0 - 36
assets/res/game/ui/game/bg_game.png.meta

@@ -1,36 +0,0 @@
-{
-  "ver": "2.3.5",
-  "uuid": "c2173721-63b6-442f-9ae5-dba9fc4979d5",
-  "type": "sprite",
-  "wrapMode": "clamp",
-  "filterMode": "bilinear",
-  "premultiplyAlpha": false,
-  "genMipmaps": false,
-  "packable": true,
-  "width": 750,
-  "height": 1334,
-  "platformSettings": {},
-  "subMetas": {
-    "bg_game": {
-      "ver": "1.0.4",
-      "uuid": "a9d06103-168c-4add-8352-0ed57f2c954e",
-      "rawTextureUuid": "c2173721-63b6-442f-9ae5-dba9fc4979d5",
-      "trimType": "auto",
-      "trimThreshold": 1,
-      "rotated": false,
-      "offsetX": 0,
-      "offsetY": 0,
-      "trimX": 0,
-      "trimY": 0,
-      "width": 750,
-      "height": 1334,
-      "rawWidth": 750,
-      "rawHeight": 1334,
-      "borderTop": 0,
-      "borderBottom": 0,
-      "borderLeft": 0,
-      "borderRight": 0,
-      "subMetas": {}
-    }
-  }
-}

+ 0 - 433
assets/resources/game/prefab/redbagitem.prefab

@@ -1,433 +0,0 @@
-[
-  {
-    "__type__": "cc.Prefab",
-    "_name": "",
-    "_objFlags": 0,
-    "_native": "",
-    "data": {
-      "__id__": 1
-    },
-    "optimizationPolicy": 0,
-    "asyncLoadAssets": false,
-    "readonly": false
-  },
-  {
-    "__type__": "cc.Node",
-    "_name": "redbagitem",
-    "_objFlags": 0,
-    "_parent": null,
-    "_children": [
-      {
-        "__id__": 2
-      },
-      {
-        "__id__": 5
-      },
-      {
-        "__id__": 8
-      }
-    ],
-    "_active": true,
-    "_components": [
-      {
-        "__id__": 11
-      }
-    ],
-    "_prefab": {
-      "__id__": 12
-    },
-    "_opacity": 255,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 115,
-      "height": 108
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 0.5
-    },
-    "_trs": {
-      "__type__": "TypedArray",
-      "ctor": "Float64Array",
-      "array": [
-        -160,
-        0,
-        0,
-        0,
-        0,
-        0,
-        1,
-        1,
-        1,
-        1
-      ]
-    },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "_groupIndex": 0,
-    "groupIndex": 0,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.Node",
-    "_name": "qipao_hb",
-    "_objFlags": 0,
-    "_parent": {
-      "__id__": 1
-    },
-    "_children": [],
-    "_active": true,
-    "_components": [
-      {
-        "__id__": 3
-      }
-    ],
-    "_prefab": {
-      "__id__": 4
-    },
-    "_opacity": 255,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 61,
-      "height": 79
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 0.5
-    },
-    "_trs": {
-      "__type__": "TypedArray",
-      "ctor": "Float64Array",
-      "array": [
-        0,
-        0,
-        0,
-        0,
-        0,
-        0,
-        1,
-        1,
-        1,
-        1
-      ]
-    },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "_groupIndex": 0,
-    "groupIndex": 0,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.Sprite",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 2
-    },
-    "_enabled": true,
-    "_materials": [
-      {
-        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
-      }
-    ],
-    "_srcBlendFactor": 770,
-    "_dstBlendFactor": 771,
-    "_spriteFrame": {
-      "__uuid__": "292c026e-580c-48ee-aecb-afaf6a560a63"
-    },
-    "_type": 0,
-    "_sizeMode": 1,
-    "_fillType": 0,
-    "_fillCenter": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0
-    },
-    "_fillStart": 0,
-    "_fillRange": 0,
-    "_isTrimmedMode": true,
-    "_atlas": null,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 1
-    },
-    "asset": {
-      "__uuid__": "ec923f8e-c546-49d0-b91f-36dfbf416120"
-    },
-    "fileId": "a4O9/qknhGraevb8T8KhzD",
-    "sync": false
-  },
-  {
-    "__type__": "cc.Node",
-    "_name": "qipao",
-    "_objFlags": 0,
-    "_parent": {
-      "__id__": 1
-    },
-    "_children": [],
-    "_active": true,
-    "_components": [
-      {
-        "__id__": 6
-      }
-    ],
-    "_prefab": {
-      "__id__": 7
-    },
-    "_opacity": 255,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 115,
-      "height": 108
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 0.5
-    },
-    "_trs": {
-      "__type__": "TypedArray",
-      "ctor": "Float64Array",
-      "array": [
-        0,
-        0,
-        0,
-        0,
-        0,
-        0,
-        1,
-        1,
-        1,
-        1
-      ]
-    },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "_groupIndex": 0,
-    "groupIndex": 0,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.Sprite",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 5
-    },
-    "_enabled": true,
-    "_materials": [
-      {
-        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
-      }
-    ],
-    "_srcBlendFactor": 770,
-    "_dstBlendFactor": 771,
-    "_spriteFrame": {
-      "__uuid__": "20a8e97d-7bce-4667-917e-7ccabdbf66b9"
-    },
-    "_type": 0,
-    "_sizeMode": 1,
-    "_fillType": 0,
-    "_fillCenter": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0
-    },
-    "_fillStart": 0,
-    "_fillRange": 0,
-    "_isTrimmedMode": true,
-    "_atlas": null,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 1
-    },
-    "asset": {
-      "__uuid__": "ec923f8e-c546-49d0-b91f-36dfbf416120"
-    },
-    "fileId": "2eDjIWmr9Plpd0KSJ9ZNC+",
-    "sync": false
-  },
-  {
-    "__type__": "cc.Node",
-    "_name": "New Label",
-    "_objFlags": 0,
-    "_parent": {
-      "__id__": 1
-    },
-    "_children": [],
-    "_active": true,
-    "_components": [
-      {
-        "__id__": 9
-      }
-    ],
-    "_prefab": {
-      "__id__": 10
-    },
-    "_opacity": 255,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 40,
-      "height": 25.2
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 0.5
-    },
-    "_trs": {
-      "__type__": "TypedArray",
-      "ctor": "Float64Array",
-      "array": [
-        0,
-        -15,
-        0,
-        0,
-        0,
-        0,
-        1,
-        1,
-        1,
-        1
-      ]
-    },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "_groupIndex": 0,
-    "groupIndex": 0,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.Label",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 8
-    },
-    "_enabled": true,
-    "_materials": [
-      {
-        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
-      }
-    ],
-    "_srcBlendFactor": 770,
-    "_dstBlendFactor": 771,
-    "_string": "可领",
-    "_N$string": "可领",
-    "_fontSize": 20,
-    "_lineHeight": 20,
-    "_enableWrapText": true,
-    "_N$file": null,
-    "_isSystemFontUsed": true,
-    "_spacingX": 0,
-    "_batchAsBitmap": false,
-    "_styleFlags": 0,
-    "_underlineHeight": 0,
-    "_N$horizontalAlign": 1,
-    "_N$verticalAlign": 1,
-    "_N$fontFamily": "Arial",
-    "_N$overflow": 0,
-    "_N$cacheMode": 0,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 1
-    },
-    "asset": {
-      "__uuid__": "ec923f8e-c546-49d0-b91f-36dfbf416120"
-    },
-    "fileId": "84LccR5rlKP6thQuhZGcgR",
-    "sync": false
-  },
-  {
-    "__type__": "b8d2cnq+GZLFK30xbLDqr/m",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 1
-    },
-    "_enabled": true,
-    "panel_name": "module/reward/rewardLuck",
-    "open_type": 0,
-    "transition_type": 0,
-    "onComplete": [],
-    "_id": ""
-  },
-  {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 1
-    },
-    "asset": {
-      "__uuid__": "ec923f8e-c546-49d0-b91f-36dfbf416120"
-    },
-    "fileId": "",
-    "sync": false
-  }
-]

+ 0 - 8
assets/resources/game/prefab/redbagitem.prefab.meta

@@ -1,8 +0,0 @@
-{
-  "ver": "1.2.9",
-  "uuid": "ec923f8e-c546-49d0-b91f-36dfbf416120",
-  "optimizationPolicy": "AUTO",
-  "asyncLoadAssets": false,
-  "readonly": false,
-  "subMetas": {}
-}

+ 3 - 3
assets/scene/MainScene.fire

@@ -6548,7 +6548,7 @@
     "sync": false
   },
   {
-    "__type__": "04588ijsS9NoIkO6fWFje+J",
+    "__type__": "a2b96K4aRpIurudLqdatOeW",
     "_name": "",
     "_objFlags": 0,
     "node": {
@@ -6556,7 +6556,7 @@
     },
     "_enabled": true,
     "node_bg": {
-      "__id__": 14
+      "__id__": 13
     },
     "node_top": {
       "__id__": 19
@@ -6627,7 +6627,7 @@
     "node_touchListenMask": {
       "__id__": 169
     },
-    "_id": "4068bb8B1IzaqFDwCMj8Mp"
+    "_id": "6aIBgUMXFKk4Gsjh0xM5fr"
   },
   {
     "__type__": "cc.PrefabInfo",

+ 0 - 1205
assets/script/before/Game.ts

@@ -1,1205 +0,0 @@
-import CellItem from "./view/uiItem/CellItem";
-import { PROPTYPE, CHECKDIR, SURPRISETASKTYPE } from "./data/Enum";
-import PoolMgr, { NODEPOOLPREFABTYPE } from "./mgr/PoolMgr";
-import GameConst from "./data/GameConst";
-import GameLogic from "./util/GameLogic";
-import ArtNum from "./util/common/ArtNum";
-import BonusTip from "./view/effect/BonusTip";
-import PlayerConst from "./data/PlayerConst";
-import DataMgr from "./mgr/DataMgr";
-import RedPacketUI from "./view/RedPacketUI";
-import LevelRedPacketItem from "./view/uiItem/LevelRedPacketItem";
-import EffectMgr, { TIP_SPRITEITEM_TYPE } from "./mgr/EffectMgr";
-import GameMgr, { UI_NAME } from "./mgr/GameMgr";
-import { AUDIO_TYPE, EVENT_TYPE } from "../game/data/GameData";
-
-const { ccclass, property } = cc._decorator;
-
-@ccclass
-export default class Game extends cc.Component {
-
-    /**单例模式 */
-    public static Inst: Game = null;
-
-    /**背景 */
-    @property(cc.Node)
-    node_bg: cc.Node = null;
-
-    /**标题 */
-    @property(cc.Node)
-    node_top: cc.Node = null;
-    @property(cc.Node)
-    node_goal: cc.Node = null;
-    /**目标分数 */
-    @property(ArtNum)
-    artNum_targetScore: ArtNum = null;
-
-    /**得分 */
-    @property(ArtNum)
-    artNum_score: ArtNum = null;
-    /**关卡数目 */
-    @property(ArtNum)
-    artNum_level: ArtNum = null;
-
-    /**内容 */
-    @property(cc.Node)
-    node_content: cc.Node = null;
-    /**cell背景块 */
-    @property(cc.Node)
-    node_cellBg: cc.Node = null;
-
-    /**红包图标 */
-    @property(cc.Node)
-    node_redPacketIcon: cc.Node = null;
-    /**红包动画 */
-    @property(cc.Animation)
-    ani_redPacketIcon: cc.Animation = null;
-
-    /**暂停按钮 */
-    @property(cc.Node)
-    node_pauseBtn: cc.Node = null;
-
-    /**进度条UI */
-    @property(cc.Node)
-    node_progressUI: cc.Node = null;
-    @property(cc.ProgressBar)
-    bar_progress: cc.ProgressBar = null;
-    @property(cc.Node)
-    node_progressIcon: cc.Node = null;
-
-    /**重置按钮 */
-    @property(cc.Node)
-    node_resetBtn: cc.Node = null;
-    @property(cc.Label)
-    label_resetPropNum: cc.Label = null;
-    /**锤子按钮 */
-    @property(cc.Node)
-    node_hammerBtn: cc.Node = null;
-    @property(cc.Label)
-    label_hammerPropNum: cc.Label = null;
-    /**变色按钮 */
-    @property(cc.Node)
-    node_changeBtn: cc.Node = null;
-    @property(cc.Label)
-    label_changePropNum: cc.Label = null;
-
-    /**更改CellItemUI */
-    @property(cc.Node)
-    node_changeCellItemUI: cc.Node = null;
-
-    /**特效UI */
-    @property(cc.Node)
-    node_effectUI: cc.Node = null;
-
-    /**关卡红包UI */
-    @property(cc.Node)
-    node_levelRedPacketUI: cc.Node = null;
-
-    /**点击检测遮罩 */
-    @property(cc.Node)
-    node_touchListenMask: cc.Node = null;
-
-    /**当前进度得分 */
-    public curProgressScore: number = 0;
-    /**当前得分 */
-    public curGetScore: number = 0;
-    /**目标分数 */
-    public targetScore: number = 100000;
-    /**最终得分 */
-    public finalGetScore: number = 0;
-    /**增加得分速度 */
-    public addScoreSpeed: number = 4;
-
-    // /**道具类型 */
-    // public curPropType: PROPTYPE = PROPTYPE.Null;
-
-    /**消消的方块数组
-     * @param:key index_x
-     * @param: value 整个纵列数组
-     */
-    public cellItemDic: { [key: number]: CellItem[] } = {};
-
-    public cellItemArr: CellItem[] = [];
-
-    /**清理CellItem的Vec数组 */
-    public cleanedVecArr: cc.Vec2[] = [];
-
-    /**能够清理的vecArr组 */
-    public couldCleanVecArr: cc.Vec2[] = [];
-
-    /**清理纵列的x */
-    public cleanXIndexArr: number[] = [];
-    /**所有的清理 */
-    public allCleanedXArr: number[] = [];
-    /**剩余未移除的xIndex */
-    public leftXIndexArr: number[] = [];
-
-    /**当前选择的cellItem */
-    public curSelectCellItem: CellItem = null;
-
-    /**当前点击得cellItem */
-    public curClickCellItem: CellItem = null;
-
-    /**当前选择的道具按钮 */
-    public curSelectPropBtn: cc.Node = null;
-
-    /**是否可以点击 */
-    public ifCouldClick: boolean = true;
-
-    /**是否已经通关 */
-    public ifPass: boolean = false;
-    /**是否获取后台回调 */
-    public ifGetPass: boolean = false;
-
-    /**当前的道具类型 */
-    private _curPropType: PROPTYPE;
-    public get curPropType(): PROPTYPE {
-        return this._curPropType;
-    }
-    public set curPropType(v: PROPTYPE) {
-        //LogUtil.log("this.curSelectPropBtn", this.curSelectPropBtn);
-        let ani = null;
-        if (this.curSelectPropBtn) {
-            mk.console.log("this.curSelectPropBtn", this.curSelectPropBtn);
-            ani = this.curSelectPropBtn.children[1].getComponent(cc.Animation);
-        }
-        if (v == PROPTYPE.Null) {
-            if (ani) {
-                ani.play("ani_normalBtn");
-            }
-            this.setPropBtnNormalTip(this.curSelectPropBtn)
-        }
-        else {
-            if (ani) {
-                ani.play("ani_selectBtn");
-            }
-            this.setPropBtnSelectTip(this.curSelectPropBtn)
-        }
-        this._curPropType = v;
-    }
-
-    // LIFE-CYCLE CALLBACKS:
-
-    onLoad() {
-        Game.Inst = this;
-    }
-
-    public start() {
-        PoolMgr.Inst.initPoolPrefab();
-        GameConst.loadConfig().then(() => {
-            this.adapt();
-
-            // AudioMgr.Inst.playMusic(AUDIO_CLIP_NAME.bg_game);
-            mk.audio.playMusic("music_gameBg");
-
-            this.initView();
-            this.initEvent();
-
-            this.intervalShowGuide();
-        }).catch();
-    }
-
-    onEnable() {
-        mk.console.log("PROPTYPE[PROPTYPE.Change]", PROPTYPE.Change);
-        GameMgr.Inst.sendEvent(UI_NAME.Game, "进入游戏界面");
-        // this.initLevel();
-    }
-
-    onDisable() {
-        //退出游戏归置下道具状态
-        this.curPropType = PROPTYPE.Null;
-        if (this.curSelectCellItem) {
-            this.curSelectCellItem.normal();
-        }
-        if (this.node_changeCellItemUI.active = true) {
-            this.node_changeCellItemUI.active = false;
-        }
-        //this.clearSurpriseTask();
-    }
-
-    adapt() {
-        mk.console.log("进行适配!!!!!!!!!!!!!!!!");
-        //背景适配
-        this.node_bg.setContentSize(new cc.Size(cc.winSize.width, cc.winSize.height));
-        this.node_top.y = (cc.winSize.height - this.node_top.height) * 0.5 + 5;
-    }
-
-    update(dt) {
-        if (this.curProgressScore >= this.curGetScore) {
-            if (this.curProgressScore == 0) {
-                this.bar_progress.progress = 0;
-            }
-            return;
-        }
-        else {
-            if (this.curProgressScore >= this.targetScore) {
-                this.curProgressScore = this.curGetScore;
-                this.initScore();
-            }
-            else {
-
-                let nextProgressScore: number = this.curProgressScore + this.addScoreSpeed;
-
-                if (this.curProgressScore < Game.Inst.targetScore && nextProgressScore >= Game.Inst.targetScore) {
-                    this.ani_redPacketIcon.play("ani_redPacket_icon_on");
-                    let node_getTargetScoreTip = PoolMgr.Inst.getPoolPrefab(NODEPOOLPREFABTYPE.GetTargetScoreTip);
-                    Game.Inst.node_effectUI.addChild(node_getTargetScoreTip);
-                }
-
-                this.curProgressScore = nextProgressScore;
-                if (this.curProgressScore >= this.curGetScore) {
-                    this.curProgressScore = this.curGetScore;
-                }
-                this.initScore();
-            }
-        }
-    }
-
-    /**初始化视图 */
-    initView() {
-        this.initLevel();
-        this.initTotalScore();
-        this.initScore();
-        this.initProgress();
-        this.initHammerPropNum();
-        this.setPropBtnNormalTip(this.node_hammerBtn);
-        this.initResetPropNum();
-        this.setPropBtnNormalTip(this.node_resetBtn);
-        this.initChanegPropNum();
-        this.setPropBtnNormalTip(this.node_changeBtn);
-        this.initCellBg();
-        this.initCell();
-    }
-
-    /**初始化事件 */
-    initEvent() {
-        this.node_pauseBtn.on(cc.Node.EventType.TOUCH_END, this.onClickBtn, this);
-        this.node_resetBtn.on(cc.Node.EventType.TOUCH_END, this.onClickBtn, this);
-        this.node_hammerBtn.on(cc.Node.EventType.TOUCH_END, this.onClickBtn, this);
-        this.node_changeBtn.on(cc.Node.EventType.TOUCH_END, this.onClickBtn, this);
-
-        this.node_redPacketIcon.on(cc.Node.EventType.TOUCH_END, this.onClickRedPacketIcon, this);
-
-        if (!GameConst.isAuth) {
-            mk.event.register(EVENT_TYPE.BACK_WxAuth, this.onWxAuthBack, this);
-        }
-    }
-
-    /**初始化关卡数目 */
-    initLevel() {
-        mk.console.log("[Game] PlayerConst.levelNum", PlayerConst.levelNum);
-        this.artNum_level.init(PlayerConst.levelNum + 1);
-    }
-
-    /**初始化总分数 */
-    initTotalScore() {
-        //加入一些随机值,而不是都能获得过关红包
-        this.targetScore = 450 + PlayerConst.levelNum * (5 + Math.floor(Math.random() * 15));
-        // //测试切换
-        // this.targetScore = 5000;
-        this.addScoreSpeed = Math.floor(this.targetScore / 400) * 2 + 4;
-        mk.console.log("this.addScoreSpeed", this.addScoreSpeed);
-        this.artNum_targetScore.init(this.targetScore);
-    }
-
-    /**初始化得分 */
-    initScore() {
-        this.artNum_score.init(this.curProgressScore);
-        this.initProgress();
-    }
-
-    /**初始化进度 */
-    initProgress() {
-        let progress = this.curProgressScore / this.targetScore;
-        progress = progress > 1 ? 1 : progress;
-        this.bar_progress.progress = progress;
-        // LogUtil.log("progressprogressprogressprogressprogressprogress", progress);
-        if (progress == 0) {
-            this.node_progressIcon.active = false;
-        }
-        else if (progress == 1) {
-
-        }
-        else {
-            if (this.node_progressIcon.active == false) {
-                this.node_progressIcon.active = true;
-            }
-        }
-        this.node_progressIcon.x = this.bar_progress.totalLength * progress - this.bar_progress.totalLength * 0.5 - 5;
-    }
-
-    /**初始化道具 */
-    initPropNum() {
-        this.initHammerPropNum();
-        this.initResetPropNum();
-        this.initChanegPropNum();
-    }
-
-    /**初始化锤子道具数目 */
-    initHammerPropNum() {
-        if (PlayerConst.hanmmerPropNum > 0) {
-            this.label_hammerPropNum.string = PlayerConst.hanmmerPropNum.toString();
-        }
-        else {
-            this.label_hammerPropNum.string = "+";
-        }
-    }
-
-    /**初始化重置道具数目 */
-    initResetPropNum() {
-        if (PlayerConst.resetPropNum) {
-            this.label_resetPropNum.string = PlayerConst.resetPropNum.toString();
-        }
-        else {
-            this.label_resetPropNum.string = "+";
-        }
-    }
-
-    /**初始化替换道具数目 */
-    initChanegPropNum() {
-        if (PlayerConst.changePropNum) {
-            this.label_changePropNum.string = PlayerConst.changePropNum.toString();
-        }
-        else {
-            this.label_changePropNum.string = "+";
-        }
-    }
-
-    // update (dt) {}
-
-    /**初始化cellBg */
-    initCellBg() {
-        for (var i = 0; i < GameConst.col_num; i++) {
-            for (var j = 0; j < GameConst.row_num; j++) {
-                let prefab_cellBg = PoolMgr.Inst.getPoolPrefab(NODEPOOLPREFABTYPE.CellBg);
-                // LogUtil.log("prefab_cellBg", prefab_cellBg);
-                let node_cellBg = cc.instantiate(prefab_cellBg);
-                this.node_cellBg.addChild(node_cellBg);
-            }
-        }
-    }
-
-    /**初始化cell */
-    public initCell() {
-        this.addCellItemFuc = () => { this.addCellItem(); };
-        this.schedule(this.addCellItemFuc, 0.05);
-    }
-
-    public addCellItemFuc: Function = null;
-
-    public curXIndex: number = 0;
-    public curYIndex: number = 7;
-
-    /**添加CellItem */
-    public addCellItem() {
-        mk.console.log("addCellItem!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
-        this.addColCellItem();
-        this.curXIndex++;
-        if (this.curXIndex >= GameConst.col_num) {
-            this.unschedule(this.addCellItemFuc);
-        }
-    }
-
-    /**添加纵列的cellItem */
-    public addColCellItem() {
-        this.cellItemDic[this.curXIndex] = [];
-        for (var i = GameConst.row_num - 1; i >= 0; i--) {
-            let prefab_cellItem = PoolMgr.Inst.getPoolPrefab(NODEPOOLPREFABTYPE.CellItem);
-            let node_prefab = cc.instantiate(prefab_cellItem);
-            let cellItem = node_prefab.getComponent(CellItem);
-            cellItem.init(this.curXIndex, i);
-            this.cellItemDic[this.curXIndex][i] = cellItem;
-            this.cellItemArr.push(cellItem);
-            this.node_content.addChild(node_prefab);
-        }
-    }
-
-    /**点击按钮 */
-    onClickBtn(event: cc.Event.EventTouch) {
-
-        this.intervalShowGuide();
-
-        //是否已经通关
-        if (this.ifPass) {
-            EffectMgr.Inst.addTip("通关结算啦,请稍后操作哈")
-            return;
-        }
-
-        // AudioMgr.Inst.playEffect(AUDIO_CLIP_NAME.buttonClick);
-        mk.audio.playEffect("ef_button_click");
-
-        switch (event.currentTarget) {
-            case this.node_pauseBtn:
-                this.onClickPauseBtn();
-                break;
-            case this.node_hammerBtn:
-                this.onClickHammerBtn();
-                break;
-            case this.node_changeBtn:
-                this.onClickChangeBtn();
-                break;
-            case this.node_resetBtn:
-                this.onClickResetBtn();
-                break;
-        }
-    }
-
-    /**点击暂停按钮 */
-    onClickPauseBtn() {
-        GameMgr.Inst.sendEvent(UI_NAME.Game, "点击暂停按钮");
-        mk.ui.openPanel("game/prefab/uiPanel/PauseUI")
-    }
-
-
-    /**点击重置按钮 */
-    onClickResetBtn() {
-        //this.intervalShowGuide();
-        GameMgr.Inst.sendEvent(UI_NAME.Game, "点击重置道具按钮");
-
-        //设置当前选择的道具按钮
-        this.setCurSelectPropBtn(this.node_resetBtn);
-
-        this.curPropType = PROPTYPE.Reset;
-        console.log("PlayerConst.resetPropNum", PlayerConst.resetPropNum);
-        if (PlayerConst.resetPropNum <= 0) {
-            mk.ui.openPanel("game/prefab/uiPanel/GetPropUI");
-            return;
-        }
-
-        // AudioMgr.Inst.playEffect(AUDIO_CLIP_NAME.refresh);
-        mk.audio.playEffect("ef_refresh");
-
-        let keys = Object.keys(this.cellItemDic);
-        for (var i = 0; i < keys.length; i++) {
-            let key = Number(keys[i]);
-            let colCellItemArr = this.cellItemDic[key];
-            for (var j = 0; j < colCellItemArr.length; j++) {
-                let cellItem = colCellItemArr[j];
-                if (cellItem) {
-                    cellItem.reset();
-                }
-            }
-        }
-
-        //暂时不扣
-        DataMgr.Inst.updatePropNum(2, Game.Inst.curPropType, -1);
-
-        this.curPropType = PROPTYPE.Null;
-
-        //this.recycleAllCellItem();
-    }
-
-    //点击锤子按钮
-    onClickHammerBtn() {
-        GameMgr.Inst.sendEvent(UI_NAME.Game, "点击消除锤道具按钮");
-        //this.intervalShowGuide();
-
-        //设置当前选择的道具按钮
-        this.setCurSelectPropBtn(this.node_hammerBtn);
-
-        this.curPropType = PROPTYPE.Hammer;
-
-        console.log("PlayerConst.hanmmerPropNum", PlayerConst.hanmmerPropNum);
-        if (PlayerConst.hanmmerPropNum <= 0) {
-            mk.ui.openPanel("game/prefab/uiPanel/GetPropUI");
-            return;
-        }
-
-        DataMgr.Inst.updatePropNum(2, Game.Inst.curPropType, -1);
-    }
-
-    //点击更换按钮
-    onClickChangeBtn() {
-        GameMgr.Inst.sendEvent(UI_NAME.Game, "点击变化方块按钮");
-        //this.intervalShowGuide();
-
-        //设置当前选择的道具按钮
-        this.setCurSelectPropBtn(this.node_changeBtn);
-        console.log("PlayerConst.changePropNum", PlayerConst.changePropNum);
-
-        this.curPropType = PROPTYPE.Change;
-        if (PlayerConst.changePropNum <= 0) {
-            mk.ui.openPanel("game/prefab/uiPanel/GetPropUI");
-            return;
-        }
-
-        DataMgr.Inst.updatePropNum(2, Game.Inst.curPropType, -1);
-    }
-
-    /**更改cellItem类型
-     * @param cellItemType
-     */
-    changeCellItemType(cellItemType: number) {
-
-        let pos_x = this.curSelectCellItem.node.x + Game.Inst.node_content.x;
-        let pos_y = this.curSelectCellItem.node.y + Game.Inst.node_content.y;
-
-        let node_change = PoolMgr.Inst.getPoolPrefab(NODEPOOLPREFABTYPE.Change);
-        node_change.setPosition(pos_x, pos_y);
-        Game.Inst.node_effectUI.addChild(node_change);
-
-        this.curSelectCellItem.setType(cellItemType)
-
-        // AudioMgr.Inst.playEffect(AUDIO_CLIP_NAME.change);
-        mk.audio.playEffect("ef_change");
-
-
-        this.curSelectCellItem = null;
-    }
-
-    /**设置当前 */
-    setCurSelectPropBtn(propBtn: cc.Node) {
-        if (this.curSelectPropBtn) {
-            let node_ani = this.curSelectPropBtn.children[1];
-            if (node_ani) {
-                let ani = node_ani.getComponent(cc.Animation);
-                if (ani) {
-                    ani.play("ani_normalBtn");
-                }
-            }
-            this.setPropBtnNormalTip(this.curSelectPropBtn);
-        }
-        this.curSelectPropBtn = propBtn;
-    }
-
-    /**设置道具普通提示 */
-    setPropBtnNormalTip(propBtn: cc.Node) {
-
-        if (!propBtn) {
-            return;
-        }
-
-        let node_tip = propBtn.children[2];
-        if (node_tip) {
-            let label = null;
-            switch (propBtn) {
-                case this.node_hammerBtn:
-                    label = this.label_hammerPropNum;
-                    break;
-                case this.node_resetBtn:
-                    label = this.label_resetPropNum;
-                    break;
-                case this.node_changeBtn:
-                    label = this.label_changePropNum;
-                    break;
-            }
-            let str = label.string;
-            let num = Number(str);
-            let label_tip = node_tip.getComponent(cc.Label);
-            mk.console.log("propBtn.name", propBtn.name);
-            mk.console.log("num", num);
-            if (num && num >= 1) {
-                label_tip.string = "";
-            }
-            else {
-                label_tip.string = "点我领取";
-            }
-        }
-    }
-
-    /**设置道具使用提示 */
-    setPropBtnSelectTip(propBtn: cc.Node) {
-        if (!propBtn) {
-            return;
-        }
-        let node_tip = propBtn.children[2];
-        if (node_tip) {
-            let label = node_tip.getComponent(cc.Label)
-            label.string = "道具使用中";
-        }
-    }
-
-    /**显示CellItemUI */
-    showChangeCellItemUI() {
-
-        let cruSelectCellItem = this.curSelectCellItem;
-        Game.Inst.node_changeCellItemUI.active = true;
-        // let min_x = -this.node_content.width * 0.5 + this.node_changeCellItemUI.width * 0.5;
-        // let max_x = this.node_content.width * 0.5 + this.node_changeCellItemUI.width * 0.5;
-        Game.Inst.node_changeCellItemUI.y = cruSelectCellItem.node.y + cruSelectCellItem.node.height * 0.5 + Game.Inst.node_changeCellItemUI.height * 0.5 + 20;
-    }
-
-    //onClick
-    onClickRedPacketIcon() {
-        if (this.bar_progress.progress == 1) {
-            EffectMgr.Inst.addTip("已达成目标啦,过关发放哦");
-        }
-        else {
-            EffectMgr.Inst.addTip("达到目标分数,才能领取哦");
-        }
-    }
-
-    //自定义事件---------------------------------------------------------------------
-    /**微信授权返回 */
-    onWxAuthBack() {
-        if (this.node.active) {
-            this.restart(false);
-            //
-            let node_redPacketUI = mk.ui.getCurOnPanel("RedPacketUI")
-            if (node_redPacketUI) {
-                mk.ui.closePanel("RedPacketUI");
-            }
-        }
-
-        this.initLevel();
-        this.initTotalScore();
-        this.initPropNum();
-
-        mk.event.remove(EVENT_TYPE.BACK_WxAuth, this.onWxAuthBack, this);
-    }
-
-    //其他显示或逻辑项-------------------------------------------------------------------
-    /**根据vecList清除cellItem */
-    public cleanCellItemByVecList() {
-
-        //LogUtil.log("[Game] Game.Inst.cleanCellItemVecArr", Game.Inst.cleanCellItemVecArr);
-
-        //没有可清清除
-        if (Game.Inst.cleanedVecArr.length <= 0) {
-            //FC:+ 是否可以点击
-            this.ifCouldClick = true;
-            EffectMgr.Inst.addTip("点击两个或以上消除哦");
-            return;
-        }
-
-        //区分消除音效
-        if (Game.Inst.cleanedVecArr.length >= 4) {
-            // AudioMgr.Inst.playEffect(AUDIO_CLIP_NAME.eliminate_bonus);
-            mk.audio.playEffect("ef_eliminate_bonus");
-        }
-        else {
-            //AudioMgr.Inst.playEffect(AUDIO_CLIP_NAME.eliminate);
-            mk.audio.playEffect("ef_eliminate");
-        }
-
-        // AudioMgr.Inst.playEffect(AUDIO_CLIP_NAME.fly);
-        mk.audio.playEffect("ef_fly");
-
-        //同时消除
-        for (var i = 0; i < Game.Inst.cleanedVecArr.length; i++) {
-            let vec = Game.Inst.cleanedVecArr[i];
-
-            //最后一个判定
-            if (i == Game.Inst.cleanedVecArr.length - 1) {
-                this.checkBonusNum(Game.Inst.cleanedVecArr.length);
-                Game.Inst.cellItemDic[vec.x][vec.y].recycle(false, true);
-            }
-            else {
-                Game.Inst.cellItemDic[vec.x][vec.y].recycle();
-            }
-
-            //回收 注释 改成如上
-            //Game.Inst.cellItemDic[vec.x][vec.y].recycle();
-
-            //Game.Inst.cellItemDic[vec.x][vec.y] = null;
-
-            if (this.cleanXIndexArr.indexOf(vec.x) == -1) {
-                this.cleanXIndexArr.push(vec.x);
-            }
-        }
-        this.cleanXIndexArr.sort();
-
-        //计算下全部移除的
-        this.allCleanedXArr = GameLogic.getAllCleanXIndex(this.cleanXIndexArr);
-
-        //FC:移除完,检测下落
-        this.scheduleOnce(() => {
-            //检测下落
-            this.checkMoveDownCellItem();
-        }, 0.2)
-    }
-
-    /**检测向下移动的cellItem */
-    checkMoveDownCellItem() {
-        mk.console.log("this.cleanXIndexArr", this.cleanXIndexArr);
-        for (var i = 0; i < this.cleanXIndexArr.length; i++) {
-            let xIndex = this.cleanXIndexArr[i];
-            this.moveYCellItem(xIndex);
-        }
-    }
-
-    /**移动
-     * @param xIndex 移除的纵列
-     * @param removedYIndex 移除的横向index
-     */
-    public moveYCellItem(xIndex: number) {
-
-        // LogUtil.log("moveYCellItem x", xIndex, this.allCleanedXArr);
-
-        /**移动的次序(第几个移动的用来控制延迟移动的时间) */
-        let movedIndex: number = 0;
-        //移动位置间隔(比如前面两个空位就移动两格)
-        let intervalNum: number = 0;
-
-        /**是否是全部清理的x */
-        let ifAllCleanedX: boolean = this.allCleanedXArr.indexOf(xIndex) != -1;
-        /**是否是最后清理的x(全部清理完才开始左移) */
-        let ifLastCleanX: boolean = (xIndex == this.cleanXIndexArr[this.cleanXIndexArr.length - 1]);
-
-        let cellItemDic = Game.Inst.cellItemDic[xIndex];
-
-        //计算y方向移动的最后一位(这样只计算一次不用循环)
-        let lastMoveCellItemY: number = null;
-        let leftLastCellItemY: number = null;
-        if (ifLastCleanX) {
-            let lastCellItemArrSort = this.cleanedVecArr.filter((vec) => vec.x == xIndex).sort();
-            lastMoveCellItemY = lastCellItemArrSort[0].y;
-            // LogUtil.log("lastCellItemY", xIndex, lastMoveCellItemY, lastCellItemArrSort);
-
-            for (var i = 0; i < GameConst.row_num; i++) {
-                if (cellItemDic) {
-                    let cellItem = cellItemDic[i];
-                    if (cellItem) {
-                        leftLastCellItemY = cellItem.y;
-                        // LogUtil.log("leftLastCellItemY", leftLastCellItemY);
-                        break;
-                    }
-                }
-            }
-            // let leftCellItemArrSort = this.cl
-        }
-
-        //如果最后一行 并且 是被全部清除的x
-        if (ifLastCleanX && ifAllCleanedX) {
-            // LogUtil.log("【checkMoveLeftCellItem】检测消除 全部消除的一列就是消除xIndex中最后一列");
-            this.checkMoveLeftCellItem();
-            return;
-        }
-        //y方向从下至上循环排查
-
-        for (var i = GameConst.row_num - 1; i >= 0; i--) {
-            if (cellItemDic) {
-                let cellItem = cellItemDic[i];
-                //该xIndex纵列没有全部移除
-                if (cellItem) {
-                    if (ifLastCleanX && i == leftLastCellItemY) {
-                        // LogUtil.log("【checkMoveLeftCellItem】检测消除 移除了最后一个");
-                        cellItem.moveDown(xIndex, i + intervalNum, movedIndex, true);
-                    }
-                    else {
-                        cellItem.moveDown(xIndex, i + intervalNum, movedIndex);
-                    }
-                    movedIndex++;
-                }
-                else {
-                    intervalNum += 1;
-                }
-            }
-            else {
-                continue;
-            }
-        }
-    }
-
-    /**检测向左移动的cellItem */
-    checkMoveLeftCellItem() {
-
-        //计算消除的纵列中,有没有被全部移除
-        //let allCleanedXArr = GameUtil.getAllCleanXIndex(this.cleanXIndexArr);
-        // LogUtil.log("[Game] checkMoveLeftCellItem  allCleanXArr ---------------------", this.allCleanedXArr);
-
-        //如果没有全部移除得就return
-        if (this.allCleanedXArr.length <= 0) {
-            //LogUtil.log("【checkMoveLeftCellItem】检测是否能消除 没有全部移除的");
-            Game.Inst.ifCouldClick = true;
-            Game.Inst.checkIfEliminate();
-            return;
-        }
-
-        //剩余一列未移除的xIndex
-        let leftXIndexArr: number[] = GameLogic.getLeftXIndexArr();
-        let leftMaxXIndex: number = leftXIndexArr[leftXIndexArr.length - 1];
-
-        if (leftXIndexArr.length <= 0) {
-            //检测是否移除
-            this.checkIfEliminate();
-        }
-        else {
-            mk.console.log("leftXIndexArr", leftXIndexArr);
-            let intervalNum: number = 0;
-            for (var i = 0; i < GameConst.col_num; i++) {
-                let cellItemArr = Game.Inst.cellItemDic[i];
-                if (this.allCleanedXArr.indexOf(i) == -1) {
-                    //剩余存在的cellItem
-                    let leftCellItemArr = cellItemArr.filter((cellItem) => cellItem != null);
-
-                    if (intervalNum > 0) {
-                        for (var j = 0; j < cellItemArr.length; j++) {
-                            let cellItem = cellItemArr[j];
-                            if (cellItem) {
-                                if (i == leftMaxXIndex && j == (leftCellItemArr[0].y)) {
-                                    mk.console.log("i,j,intervalNum", i, j, intervalNum);
-                                    cellItem.moveLeft(i - intervalNum, j, true);
-                                }
-                                else {
-                                    cellItem.moveLeft(i - intervalNum, j);
-                                }
-                            }
-                        }
-                    }
-                    else {
-                        //对应 1 2 3 列 中 3全部消除
-                        if (i == leftMaxXIndex) {
-                            Game.Inst.ifCouldClick = true;
-                            Game.Inst.checkIfEliminate();
-                        }
-                    }
-                }
-                else {
-                    intervalNum += 1;
-                }
-            }
-        }
-    }
-
-    public timeout_pass: number = 0;
-
-    /**检测是否能移除 */
-    checkIfEliminate() {
-        mk.console.log("开始检测是否还能够消除!!!!!!!!!!!!!!!!!!!!!");
-
-        //FC:测试替换
-        GameLogic.getCouldCleanVec();
-        if (this.couldCleanVecArr.length <= 0 && !this.ifPass) {
-            this.ifPass = true;
-            EffectMgr.Inst.addSpriteTip(TIP_SPRITEITEM_TYPE.NormalPass);
-            let timeOut = setTimeout(() => {
-                this.pass();
-                clearTimeout(timeOut);
-            }, 1500);
-        }
-
-        //FC:正式使用
-        // let timeOut = setTimeout(() => {
-        //     GameUtil.getCouldCleanVec();
-        //     if (this.couldCleanVecArr.length <= 0 && !this.ifPass) {
-        //         this.pass();
-        //     }
-        //     clearTimeout(timeOut);
-        // }, 1500);
-    }
-
-    getCouldCleanCellItem() {
-        for (var i = 0; this.cellItemArr.length; i++) {
-            let cellItem = this.cellItemArr[i];
-            let aroundSameType = GameLogic.getAroundSameType(cellItem.x, cellItem.y, cellItem.type, false);
-            if (aroundSameType.length > 0) {
-                return;
-            }
-        }
-        //this.nextLevel();
-        this.pass();
-        //this.recycleAllCellItem();
-    }
-
-    /**restart
-     * @param 是否扣除体力
-     */
-    restart(ifMinusEnergy: boolean = false) {
-        mk.console.log("restart!!!!!!!!!!!!!!!")
-        this.refreshGame();
-    }
-
-    /**下一关 */
-    nextLevel(ifMinusEnergy: boolean = false) {
-        mk.console.log("nextLevel!!!!!!!!!!!!!!!")
-        this.refreshGame();
-    }
-
-    /**刷新关卡 */
-    refreshGame() {
-
-        this.recycleAllRedPacket();
-        this.recycleAllCellItem();
-        this.ifPass = false;
-        this.ifGetPass = false;
-        this.ifCouldClick = true;
-        this.initLevel();
-        this.initTotalScore();
-        this.curProgressScore = 0;
-        this.curGetScore = 0;
-        this.finalGetScore = 0;
-        this.ani_redPacketIcon.play();
-        this.initScore();
-    }
-
-    /**回收红包 */
-    recycleAllRedPacket() {
-        while (this.node_levelRedPacketUI.childrenCount > 0) {
-            let node_levelRedPacket = this.node_levelRedPacketUI.children[0];
-            node_levelRedPacket.getComponent(LevelRedPacketItem).recycle();
-        }
-    }
-
-    /**回收所有的 */
-    recycleAllCellItem() {
-        for (var i = 0; i < GameConst.col_num; i++) {
-            for (var j = 0; j < GameConst.row_num; j++) {
-                let cellItem = this.cellItemDic[i][j];
-                if (cellItem) {
-                    mk.console.log("回收把>>>>>>>>>>>>>>>>>>>>>>");
-                    cellItem.recycle(true, false, false);
-                }
-            }
-        }
-        // while (this.cellItemList.length > 0) {
-        //     this.cellItemList.splice(0, 1);
-        //     this.cellItemList[0].recycle();
-        // }
-        this.cellItemArr = [];
-        this.cellItemDic = {};
-        this.curXIndex = 0;
-        this.curYIndex = GameConst.row_num - 1;
-
-        this.initCell();
-    }
-
-    /**通关 */
-    pass() {
-
-        //这边会多次进入
-        if (Game.Inst.node.active == false) {
-            return;
-        }
-
-        this.ifPass = true;
-
-        Game.Inst.ifGetPass = false;
-
-        let passLevelNum = PlayerConst.levelNum + 1;
-        mk.console.log("[Game]pass passLevelNum", passLevelNum);
-
-        Game.Inst.ifGetPass = true;
-        PlayerConst.levelNum = passLevelNum;
-
-        //视频计数
-        DataMgr.Inst.updatePassNum(++PlayerConst.passNum);
-
-        mk.console.log("PlayerConst.passNum", PlayerConst.passNum);
-
-        //游戏结算
-        this.gameCount();
-
-        // LogUtil.log("SurpriseTaskUI.ifAllCompleted", SurpriseTaskUI.ifAllCompleted);
-        // LogUtil.log("score", score);
-
-        // //发送过关消息
-        // HttpMgr.Inst.pass(passLevelNum, score).then((data) => {
-
-        //     LogUtil.log("pass data", data);
-        //     Game.Inst.ifGetPass = true;
-        //     PlayerConst.levelNum = passLevelNum;
-
-        //     //视频计数
-        //     DataMgr.Inst.updatePassNum(++PlayerConst.passNum);
-
-        //     LogUtil.log("PlayerConst.passNum", PlayerConst.passNum);
-
-        //     if (score && !data) {
-        //         DataMgr.Inst.updateShopScoreNum(score);
-        //     }
-        //     else {
-        //         //如果提示 已达单关积分获取次数!
-        //         if (data) {
-        //             SurpriseTaskUI.ifGetScore = true;
-        //             SurpriseTaskUI.getSurpriseTaskScore = 0;
-        //         }
-        //     }
-
-        //     //游戏结算
-        //     this.gameCount();
-
-        // }).catch((err) => {
-        //     LogUtil.log("pass err", err);
-        //     Game.Inst.ifGetPass = true;
-        //     if (err) {
-        //         let errCode = err.errcode;
-        //         switch (errCode) {
-        //             case 500:
-        //                 GameMgr.Inst.sendEvent("Error", `服务器发生500错误`);
-        //                 break;
-        //             case PASS_ERR_CODE.PASSNO_INCORRECT:
-        //             case PASS_ERR_CODE.PASSNO_NULL:
-        //                 GameMgr.Inst.sendEvent("PassError", `过关异常,第${PlayerConst.levelNum}关`);
-
-        //                 DataMgr.Inst.updatePassNum(++PlayerConst.passNum);
-        //                 PlayerConst.levelNum = passLevelNum;
-        //                 break;
-        //             case PASS_ERR_CODE.SCORE_OVER_TIMES:
-        //                 //视频计数
-        //                 DataMgr.Inst.updatePassNum(++PlayerConst.passNum);
-        //                 PlayerConst.levelNum = passLevelNum;
-        //                 break;
-        //             case PASS_ERR_CODE.SCORE_PARAM_ILLEGAL:
-        //                 GameMgr.Inst.sendEvent("PassError", `获取积分异常(积分传参非法)`);
-
-        //                 EffectMgr.Inst.addTip("您本次积分异常,请不要作弊哦");
-        //                 DataMgr.Inst.updatePassNum(++PlayerConst.passNum);
-        //                 PlayerConst.levelNum = passLevelNum;
-
-        //                 break;
-        //             case PASS_ERR_CODE.SCORE_REACH_LIMIT:
-        //                 GameMgr.Inst.sendEvent("PassError", `已达今日积分上限`);
-
-        //                 EffectMgr.Inst.addTip("您今天积分已达上限啦,明天再来吧");
-        //                 DataMgr.Inst.updatePassNum(++PlayerConst.passNum);
-        //                 PlayerConst.levelNum = passLevelNum;
-        //                 break;
-        //         }
-        //     }
-        //     //游戏结算
-        //     this.gameCount();
-        // });
-    }
-
-    /**游戏结算 */
-    gameCount() {
-
-        //如果随机红包激活了,那么
-        let node_levelRedPacketUI = mk.ui.getCurOnPanel("LevelRedPacketUI");
-        if (node_levelRedPacketUI) {
-            mk.ui.closePanel("LevelRedPacketUI");
-        }
-
-        let node_getPropUI = mk.ui.getCurOnPanel("GetPropUI");
-        if (node_getPropUI) {
-            mk.ui.closePanel("GetPropUI");
-        }
-
-
-        //前2关 取消红包显示  放在这边主要是 能够继续玩下去
-        if (this.finalGetScore >= this.targetScore && PlayerConst.levelNum > 2) {
-            // Main.Inst.node_gameOverUI.active = true;
-
-            let num = PlayerConst.todayTargetRedPacketNum - PlayerConst.todayPassRedPacketNum;
-            mk.console.log("num", num);
-            let tip = "";
-            if (num > 0) {
-                tip = `再领取${num}个过关红包完成今日打卡`;
-            }
-            else {
-                tip = `今日已经打卡成功,快去提现吧`;
-            }
-
-            mk.ui.openPanel("RedPacketUI").then((node) => {
-                let redPacketUI = node.getComponent(RedPacketUI);
-                redPacketUI.init("过关红包", 0.2, () => { this.gameOver() }, tip)
-            })
-        }
-        else {
-            this.gameOver();
-        }
-
-        //测试切换
-        // this.gameOver();
-    }
-
-    /**游戏结束 */
-    gameOver() {
-        mk.ui.openPanel("GameOverUI");
-    }
-
-    checkBonusNum(cleanCellItemNum: number) {
-
-        if (cleanCellItemNum >= 4) {
-            let node_bonusTip = PoolMgr.Inst.getPoolPrefab(NODEPOOLPREFABTYPE.BonusTip);
-            let bonusTip = node_bonusTip.getComponent(BonusTip);
-            //LogUtil.log("bonusTip",bonusTip);
-            if (cleanCellItemNum == 4) {
-                bonusTip.init(4);
-                // AudioMgr.Inst.playEffect(AUDIO_CLIP_NAME.bonus4);
-                mk.audio.playEffect("ef_bonus4");
-            }
-            else if (cleanCellItemNum == 5) {
-                bonusTip.init(5);
-                // AudioMgr.Inst.playEffect(AUDIO_CLIP_NAME.bonus5);
-                mk.audio.playEffect("ef_bonus5");
-            }
-            else if (cleanCellItemNum == 6) {
-                bonusTip.init(6);
-                // AudioMgr.Inst.playEffect(AUDIO_CLIP_NAME.bonus6);
-                mk.audio.playEffect("ef_bonus6");
-            }
-            else if (cleanCellItemNum == 7) {
-                bonusTip.init(7);
-                // AudioMgr.Inst.playEffect(AUDIO_CLIP_NAME.bonus7);
-                mk.audio.playEffect("ef_bonus7");
-            }
-            else if (cleanCellItemNum == 8) {
-                bonusTip.init(8);
-                // AudioMgr.Inst.playEffect(AUDIO_CLIP_NAME.bonus8);
-                mk.audio.playEffect("ef_bonus8");
-            }
-            else {
-                bonusTip.init(8);
-                // AudioMgr.Inst.playEffect(AUDIO_CLIP_NAME.bonus8);
-                mk.audio.playEffect("ef_bonus8");
-            }
-
-
-            this.node_effectUI.addChild(node_bonusTip);
-        }
-    }
-
-    checkAddLevelRedPacket(eliminateNum: number): boolean {
-        let chance = (eliminateNum - 3) * 0.2;
-        let random = Math.random();
-        if (random < chance) {
-            return true;
-        }
-        else {
-            return false;
-        }
-    }
-
-    public interval_ShowGuide: number = null;
-    //间隔显示
-    intervalShowGuide() {
-        this.cancelShowCouldCleanCellItem();
-        this.interval_ShowGuide = setInterval(() => {
-            this.showCouldCleanCellItem();
-        }, 10000);
-    }
-
-    /**显示 */
-    showCouldCleanCellItem() {
-        if (mk.ui.getCurOnPanel("RedPacketUI") || mk.ui.getCurOnPanel("GameOverUI") || !this.couldCleanVecArr || !this.cellItemDic) {
-            return;
-        }
-        if (this.couldCleanVecArr.length <= 0) {
-            GameLogic.getCouldCleanVec();
-        }
-        if (this.couldCleanVecArr.length > 0) {
-            for (var i = 0; i < this.couldCleanVecArr.length; i++) {
-                let vec = this.couldCleanVecArr[i];
-                if (this.cellItemDic[vec.x]) {
-                    let cellItem = this.cellItemDic[vec.x][vec.y];
-                    if (cellItem) {
-                        cellItem.shake();
-                    }
-                }
-                else {
-
-                }
-            }
-        }
-    }
-
-    /**取消显示 */
-    cancelShowCouldCleanCellItem() {
-        if (this.interval_ShowGuide) {
-            clearInterval(this.interval_ShowGuide);
-            this.interval_ShowGuide = null;
-            if (this.couldCleanVecArr.length > 0) {
-                for (var i = 0; i < this.couldCleanVecArr.length; i++) {
-                    let vec = this.couldCleanVecArr[i];
-                    let cellItem = this.cellItemDic[vec.x][vec.y];
-                    if (cellItem) {
-                        cellItem.normal();
-                    }
-                }
-            }
-            this.couldCleanVecArr = [];
-        }
-    }
-}

+ 0 - 9
assets/script/before/Game.ts.meta

@@ -1,9 +0,0 @@
-{
-  "ver": "1.0.8",
-  "uuid": "045888a3-b12f-4da0-890e-e9f5858def89",
-  "isPlugin": false,
-  "loadPluginInWeb": true,
-  "loadPluginInNative": true,
-  "loadPluginInEditor": false,
-  "subMetas": {}
-}

+ 8 - 8
assets/script/before/mgr/DataMgr.ts

@@ -10,7 +10,7 @@ import GameConst from "../data/GameConst";
 import Start from "../Start";
 import StorageMgr from "./StorageMgr";
 import { PROPTYPE } from "../data/Enum";
-import Game from "../Game";
+import GamePlay from "../GamePlay";
 import DailyCashOutUI from "../view/DailyCashOutUI";
 import HttpMgr from "./HttpMgr";
 import CashOutUI from "../view/CashOutUI";
@@ -235,8 +235,8 @@ export default class DataMgr extends cc.Component {
                     PlayerConst.hanmmerPropNum += propNum;
                 }
 
-                if (Game.Inst) {
-                    Game.Inst.initHammerPropNum();
+                if (GamePlay.Inst) {
+                    GamePlay.Inst.initHammerPropNum();
                 }
                 break;
             case PROPTYPE.Change:
@@ -247,8 +247,8 @@ export default class DataMgr extends cc.Component {
                     PlayerConst.changePropNum += propNum;
                 }
 
-                if (Game.Inst) {
-                    Game.Inst.initChanegPropNum();
+                if (GamePlay.Inst) {
+                    GamePlay.Inst.initChanegPropNum();
                 }
                 break;
             case PROPTYPE.Reset:
@@ -258,8 +258,8 @@ export default class DataMgr extends cc.Component {
                 else {
                     PlayerConst.resetPropNum += propNum;
                 }
-                if (Game.Inst) {
-                    Game.Inst.initResetPropNum();
+                if (GamePlay.Inst) {
+                    GamePlay.Inst.initResetPropNum();
                 }
                 break;
         }
@@ -268,7 +268,7 @@ export default class DataMgr extends cc.Component {
             return;
         }
 
-        HttpMgr.Inst.prop(updateType, Game.Inst.curPropType, 1).then((data) => {
+        HttpMgr.Inst.prop(updateType, GamePlay.Inst.curPropType, 1).then((data) => {
 
         }).catch((err) => {
 

+ 23 - 23
assets/script/before/util/GameLogic.ts

@@ -1,5 +1,5 @@
 import { CHECKDIR, PROPTYPE, SURPRISETASKTYPE } from "../data/Enum";
-import Game from "../Game";
+import GamePlay from "../GamePlay";
 import GameConst from "../data/GameConst";
 import PlayerConst from "../data/PlayerConst";
 
@@ -80,7 +80,7 @@ export default class GameLogic extends cc.Component {
                 y = index_y;
                 break;
         }
-        let cellItem = Game.Inst.cellItemDic[x][y];
+        let cellItem = GamePlay.Inst.cellItemDic[x][y];
         if (cellItem && cellItem.ifRemoved == false && cellItem.type === type) {
             if (ifTagRemoved) {
                 cellItem.ifRemoved = true;
@@ -100,7 +100,7 @@ export default class GameLogic extends cc.Component {
      */
     public static checkAboveCellItem(index_x: number, index_y: number, type: number, ifTagRemoved: boolean): cc.Vec2 {
 
-        if (!Game.Inst || !Game.Inst.cellItemDic) {
+        if (!GamePlay.Inst || !GamePlay.Inst.cellItemDic) {
             return;
         }
 
@@ -109,7 +109,7 @@ export default class GameLogic extends cc.Component {
         }
         //LogUtil.log("index_x", index_x, index_y);
         //LogUtil.log("index_y - 1",index_y - 1);
-        let cellItem = Game.Inst.cellItemDic[index_x][index_y - 1];
+        let cellItem = GamePlay.Inst.cellItemDic[index_x][index_y - 1];
         if (cellItem && cellItem.ifRemoved == false && cellItem.type === type) {
             if (ifTagRemoved) {
                 cellItem.ifRemoved = true;
@@ -129,14 +129,14 @@ export default class GameLogic extends cc.Component {
      */
     public static checkBelowCellItem(index_x: number, index_y: number, type: number, ifTagRemoved: boolean): cc.Vec2 {
 
-        if (!Game.Inst || !Game.Inst.cellItemDic) {
+        if (!GamePlay.Inst || !GamePlay.Inst.cellItemDic) {
             return;
         }
 
         if (index_y >= (GameConst.row_num - 1)) {
             return null;
         }
-        let cellItem = Game.Inst.cellItemDic[index_x][index_y + 1];
+        let cellItem = GamePlay.Inst.cellItemDic[index_x][index_y + 1];
         if (cellItem && cellItem.ifRemoved == false && cellItem.type === type) {
             if (ifTagRemoved) {
                 cellItem.ifRemoved = true;
@@ -156,7 +156,7 @@ export default class GameLogic extends cc.Component {
      */
     public static checkLeftCellItem(index_x: number, index_y: number, type: number, ifTagRemoved: boolean): cc.Vec2 {
 
-        if (!Game.Inst || !Game.Inst.cellItemDic) {
+        if (!GamePlay.Inst || !GamePlay.Inst.cellItemDic) {
             return;
         }
 
@@ -164,7 +164,7 @@ export default class GameLogic extends cc.Component {
             return null;
         }
 
-        let cellItem = Game.Inst.cellItemDic[index_x - 1][index_y];
+        let cellItem = GamePlay.Inst.cellItemDic[index_x - 1][index_y];
         if (cellItem && cellItem.ifRemoved == false && cellItem.type === type) {
             if (ifTagRemoved) {
                 cellItem.ifRemoved = true;
@@ -188,11 +188,11 @@ export default class GameLogic extends cc.Component {
             return null;
         }
 
-        if (!Game.Inst || !Game.Inst.cellItemDic || !Game.Inst.cellItemDic[index_x + 1]) {
+        if (!GamePlay.Inst || !GamePlay.Inst.cellItemDic || !GamePlay.Inst.cellItemDic[index_x + 1]) {
             return;
         }
 
-        let cellItem = Game.Inst.cellItemDic[index_x + 1][index_y];
+        let cellItem = GamePlay.Inst.cellItemDic[index_x + 1][index_y];
 
         if (cellItem && cellItem.ifRemoved == false && cellItem.type === type) {
             if (ifTagRemoved) {
@@ -228,8 +228,8 @@ export default class GameLogic extends cc.Component {
     public static getCleanedVecList(index_x: number, index_y: number, type: number, ifTagRemoved: boolean = true) {
         let aroundSameTypeItem = this.getAroundSameType(index_x, index_y, type, ifTagRemoved);
         aroundSameTypeItem.forEach((vec) => {
-            if (Game.Inst.cleanedVecArr.indexOf(vec) == -1) {
-                Game.Inst.cleanedVecArr.push(vec);
+            if (GamePlay.Inst.cleanedVecArr.indexOf(vec) == -1) {
+                GamePlay.Inst.cleanedVecArr.push(vec);
                 this.getCleanedVecList(vec.x, vec.y, type, ifTagRemoved);
             }
         });
@@ -244,8 +244,8 @@ export default class GameLogic extends cc.Component {
     public static getCouldCleanVecList(index_x: number, index_y: number, type: number, ifTagRemoved: boolean = true) {
         let aroundSameTypeItem = this.getAroundSameType(index_x, index_y, type, ifTagRemoved);
         aroundSameTypeItem.forEach((vec) => {
-            if (Game.Inst.couldCleanVecArr.indexOf(vec) == -1) {
-                Game.Inst.couldCleanVecArr.push(vec);
+            if (GamePlay.Inst.couldCleanVecArr.indexOf(vec) == -1) {
+                GamePlay.Inst.couldCleanVecArr.push(vec);
                 this.getCouldCleanVecList(vec.x, vec.y, type, ifTagRemoved);
             }
         });
@@ -253,22 +253,22 @@ export default class GameLogic extends cc.Component {
 
     /**获取能够移除的CellItem的位置信息(找到符合条件就return)*/
     public static getCouldCleanVec() {
-        let keys = Object.keys(Game.Inst.cellItemDic);
+        let keys = Object.keys(GamePlay.Inst.cellItemDic);
         for (var i = 0; i < keys.length; i++) {
             let key = Number(keys[i]);
-            let colCellItemArr = Game.Inst.cellItemDic[key];
+            let colCellItemArr = GamePlay.Inst.cellItemDic[key];
             if (colCellItemArr) {
                 for (var j = 0; j < colCellItemArr.length; j++) {
                     let cellItem = colCellItemArr[j];
                     if (cellItem) {
                         this.getCouldCleanVecList(cellItem.x, cellItem.y, cellItem.type, true)
-                        if (Game.Inst.couldCleanVecArr.length > 0) {
+                        if (GamePlay.Inst.couldCleanVecArr.length > 0) {
                             //重置ifRemoved状态
-                            for (var i = 0; i < Game.Inst.couldCleanVecArr.length; i++) {
-                                let vec = Game.Inst.couldCleanVecArr[i];
+                            for (var i = 0; i < GamePlay.Inst.couldCleanVecArr.length; i++) {
+                                let vec = GamePlay.Inst.couldCleanVecArr[i];
 
-                                if (Game.Inst.cellItemDic[vec.x]) {
-                                    let cellItem = Game.Inst.cellItemDic[vec.x][vec.y];
+                                if (GamePlay.Inst.cellItemDic[vec.x]) {
+                                    let cellItem = GamePlay.Inst.cellItemDic[vec.x][vec.y];
                                     if (cellItem) {
                                         cellItem.ifRemoved = false;
                                     }
@@ -290,7 +290,7 @@ export default class GameLogic extends cc.Component {
         //LogUtil.log("Game.Inst.cellItemDic",Game.Inst.cellItemDic);
         for (var i = 0; i < cleanXIndexArr.length; i++) {
             let xIndex = cleanXIndexArr[i];
-            let colCellItemArr = Game.Inst.cellItemDic[xIndex];
+            let colCellItemArr = GamePlay.Inst.cellItemDic[xIndex];
             let ifAllCleaned: boolean = true;
             for (var j = GameConst.row_num - 1; j >= 0; j--) {
                 if (colCellItemArr[j]) {
@@ -313,7 +313,7 @@ export default class GameLogic extends cc.Component {
     public static getLeftXIndexArr(): number[] {
         let leftXindexArr: number[] = [];
         for (var i = 0; i < GameConst.col_num; i++) {
-            let cellItemArr = Game.Inst.cellItemDic[i];
+            let cellItemArr = GamePlay.Inst.cellItemDic[i];
             let leftCellItemArr = cellItemArr.filter((cellItem) => cellItem != null);
             if (leftCellItemArr.length > 0) {
                 leftXindexArr.push(i);

+ 4 - 4
assets/script/before/view/ChangeCellItemUI.ts

@@ -1,4 +1,4 @@
-import Game from "../Game";
+import GamePlay from "../GamePlay";
 import { PROPTYPE } from "../data/Enum";
 import SelectCellItemBtn from "./uiItem/SelectCellItemBtn";
 import GameConst from "../data/GameConst";
@@ -30,9 +30,9 @@ export default class ChangeCellItemUI extends cc.Component {
     }
 
     onDisable() {
-        Game.Inst.ifCouldClick = true;
-        if (Game.Inst.curSelectCellItem) {
-            Game.Inst.curSelectCellItem.node.opacity = 255;
+        GamePlay.Inst.ifCouldClick = true;
+        if (GamePlay.Inst.curSelectCellItem) {
+            GamePlay.Inst.curSelectCellItem.node.opacity = 255;
         }
     }
 

+ 6 - 6
assets/script/before/view/GameOverUI.ts

@@ -6,7 +6,7 @@
 //  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
 
 import GameConst from "../data/GameConst";
-import Game from "../Game";
+import GamePlay from "../GamePlay";
 import PlayerConst from "../data/PlayerConst";
 import GameMgr, { UI_NAME } from "../mgr/GameMgr";
 import EffectMgr from "../mgr/EffectMgr";
@@ -81,7 +81,7 @@ export default class GameOverUI extends cc.Component {
     }
 
     initScore() {
-        this.label_score.string = Game.Inst.finalGetScore.toString();
+        this.label_score.string = GamePlay.Inst.finalGetScore.toString();
         // this.label_score.string = Game.Inst.curGetScore.toString();
         //为避免视频之后 资源显示问题(观看视频之后,文本有可能显示异常)
         this.node_score.active = true;
@@ -123,7 +123,7 @@ export default class GameOverUI extends cc.Component {
     }
 
     onClickHomeBtn() {
-        if (!Game.Inst.ifGetPass) {
+        if (!GamePlay.Inst.ifGetPass) {
             EffectMgr.Inst.addTip("结算中,等1秒再试哈");
             return;
         }
@@ -132,11 +132,11 @@ export default class GameOverUI extends cc.Component {
         // this.node.active = false;
         mk.ui.closePanel("GameOverUI");
 
-        Game.Inst.nextLevel(false);
+        GamePlay.Inst.nextLevel(false);
     }
 
     onClickContinueBtn() {
-        if (!Game.Inst.ifGetPass) {
+        if (!GamePlay.Inst.ifGetPass) {
             EffectMgr.Inst.addTip("结算中,等1秒再试哈");
             return;
         }
@@ -151,7 +151,7 @@ export default class GameOverUI extends cc.Component {
             return;
         }
 
-        Game.Inst.nextLevel();
+        GamePlay.Inst.nextLevel();
 
         mk.ui.closePanel("GameOverUI")
     }

+ 7 - 7
assets/script/before/view/GetPropUI.ts

@@ -6,7 +6,7 @@
 //  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
 
 import { PROPTYPE, SURPRISETASKTYPE, VIDEOTYPE } from "../data/Enum";
-import Game from "../Game";
+import GamePlay from "../GamePlay";
 import DataMgr from "../mgr/DataMgr";
 import EffectMgr from "../mgr/EffectMgr";
 import GameMgr, { UI_NAME } from "../mgr/GameMgr";
@@ -44,7 +44,7 @@ export default class GetPropUI extends cc.Component {
     }
 
     onDisable() {
-        Game.Inst.curPropType = PROPTYPE.Null;
+        GamePlay.Inst.curPropType = PROPTYPE.Null;
         // AdMgr.Inst.destroyNativeAd();
     }
 
@@ -57,7 +57,7 @@ export default class GetPropUI extends cc.Component {
         for (var i = 0; i < this.node_prop.childrenCount; i++) {
             let prop = this.node_prop.children[i];
             let propCode = prop.children[0] ? prop.children[0].name : "";
-            if (propCode == Game.Inst.curPropType) {
+            if (propCode == GamePlay.Inst.curPropType) {
                 prop.active = true;
             }
             else {
@@ -93,7 +93,7 @@ export default class GetPropUI extends cc.Component {
 
     /**点击获取 */
     onClickGet() {
-        GameMgr.Inst.sendEvent(UI_NAME.GetPropUI, `点击${Game.Inst.curPropType}按钮`);
+        GameMgr.Inst.sendEvent(UI_NAME.GetPropUI, `点击${GamePlay.Inst.curPropType}按钮`);
         // AdMgr.Inst.watchAd(VIDEOTYPE.GetProp, (ifsuccess) => { this, this.watchCallBack(ifsuccess) });
         // this.watchCallBack(true);
         this.watchSuccess();
@@ -113,15 +113,15 @@ export default class GetPropUI extends cc.Component {
 
     /**观看成功 */
     watchSuccess() {
-        GameMgr.Inst.sendEvent(UI_NAME.GetPropUI, `视频获取${Game.Inst.curPropType}道具成功`);
+        GameMgr.Inst.sendEvent(UI_NAME.GetPropUI, `视频获取${GamePlay.Inst.curPropType}道具成功`);
         EffectMgr.Inst.addTip("观看视频成功,获得道具");
-        DataMgr.Inst.updatePropNum(1, Game.Inst.curPropType, 1);
+        DataMgr.Inst.updatePropNum(1, GamePlay.Inst.curPropType, 1);
         mk.ui.closePanel("GetPropUI")
     }
 
     /**观看失败 */
     watchFailed() {
-        GameMgr.Inst.sendEvent(UI_NAME.GetPropUI, `视频获取${Game.Inst.curPropType}道具失败`);
+        GameMgr.Inst.sendEvent(UI_NAME.GetPropUI, `视频获取${GamePlay.Inst.curPropType}道具失败`);
         // EffectMgr.Inst.addTip("观看视频失败,请稍后再试");
     }
 }

+ 3 - 3
assets/script/before/view/PauseUI.ts

@@ -5,7 +5,7 @@
 // Learn life-cycle callbacks:
 //  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
 
-import Game from "../Game";
+import GamePlay from "../GamePlay";
 import PlayerConst from "../data/PlayerConst";
 import EffectMgr from "../mgr/EffectMgr";
 import GameMgr, { UI_NAME } from "../mgr/GameMgr";
@@ -140,7 +140,7 @@ export default class PauseUI extends cc.Component {
             return;
         }
 
-        Game.Inst.restart();
+        GamePlay.Inst.restart();
   
         // this.node.active = false;
         mk.ui.closePanel(this.node.name);
@@ -150,7 +150,7 @@ export default class PauseUI extends cc.Component {
         GameMgr.Inst.sendEvent(UI_NAME.PauseUI, "点击退出按钮");
   
         mk.ui.closePanel("PauseUI")
-        Game.Inst.restart(false);//退出不扣体力
+        GamePlay.Inst.restart(false);//退出不扣体力
         // let timeOut = setTimeout(()=>{
         //     Main.Inst.node_start.active = true;
         //     Main.Inst.node_game.active = false;

+ 10 - 10
assets/script/before/view/effect/ScoreEnergy.ts

@@ -5,7 +5,7 @@
 // Learn life-cycle callbacks:
 //  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
 
-import Game from "../../Game";
+import GamePlay from "../../GamePlay";
 import PoolMgr, { NODEPOOLPREFABTYPE } from "../../mgr/PoolMgr";
 
 const { ccclass, property } = cc._decorator;
@@ -25,13 +25,13 @@ export default class ScoreEnergy extends cc.Component {
 
     update() {
         //如果过关 则回收
-        if (Game.Inst.ifGetPass) {
+        if (GamePlay.Inst.ifGetPass) {
             mk.console.log("[到达位置]过关啦11111", this.node.x, this.node.y);
             // LogUtil.log("过关啦?????????????????", this.node.x, this.node.y);
             PoolMgr.Inst.recyclePoolPrefab(NODEPOOLPREFABTYPE.ScoreEnergy, this.node);
 
-            let nextScore = Game.Inst.curGetScore + this.score;
-            Game.Inst.curGetScore = nextScore;
+            let nextScore = GamePlay.Inst.curGetScore + this.score;
+            GamePlay.Inst.curGetScore = nextScore;
         }
     }
 
@@ -42,10 +42,10 @@ export default class ScoreEnergy extends cc.Component {
         this.node.x = x;
         this.node.y = y;
 
-        let pos_x = Game.Inst.node_progressUI.x + Game.Inst.node_progressIcon.x;
-        let pos_y = Game.Inst.node_progressUI.y;
+        let pos_x = GamePlay.Inst.node_progressUI.x + GamePlay.Inst.node_progressIcon.x;
+        let pos_y = GamePlay.Inst.node_progressUI.y;
 
-        Game.Inst.finalGetScore += score;
+        GamePlay.Inst.finalGetScore += score;
 
         cc.tween(this.node)
             .to(1, { x: pos_x, y: pos_y }, { easing: "smooth" })
@@ -54,9 +54,9 @@ export default class ScoreEnergy extends cc.Component {
                 PoolMgr.Inst.recyclePoolPrefab(NODEPOOLPREFABTYPE.ScoreEnergy, this.node);
 
                 //如果结算 过关 分数就不加
-                if (!Game.Inst.ifGetPass) {
-                    let nextScore = Game.Inst.curGetScore + score;
-                    Game.Inst.curGetScore = nextScore;
+                if (!GamePlay.Inst.ifGetPass) {
+                    let nextScore = GamePlay.Inst.curGetScore + score;
+                    GamePlay.Inst.curGetScore = nextScore;
                 }
 
                 //Game.Inst.initScore();

+ 52 - 52
assets/script/before/view/uiItem/CellItem.ts

@@ -1,4 +1,4 @@
-import Game from "../../Game";
+import GamePlay from "../../GamePlay";
 import { PROPTYPE, SURPRISETASKTYPE } from "../../data/Enum";
 import GameLogic from "../../util/GameLogic";
 import PoolMgr, { NODEPOOLPREFABTYPE } from "../../mgr/PoolMgr";
@@ -70,8 +70,8 @@ export default class CellItem extends cc.Component {
 
     /**获取结束位置 */
     getEndPos(): cc.Vec2 {
-        let endX = (this.x * this.node.width + this.node.width * 0.5) - Game.Inst.node_content.width * 0.5;
-        let endY = -(this.y * this.node.height + this.node.height * 0.5) + Game.Inst.node_content.height * 0.5;
+        let endX = (this.x * this.node.width + this.node.width * 0.5) - GamePlay.Inst.node_content.width * 0.5;
+        let endY = -(this.y * this.node.height + this.node.height * 0.5) + GamePlay.Inst.node_content.height * 0.5;
         return new cc.Vec2(endX, endY);
     }
 
@@ -123,56 +123,56 @@ export default class CellItem extends cc.Component {
     /**点击 */
     onClick() {
         //FC:是否可以点击
-        if (!Game.Inst.ifCouldClick) {
+        if (!GamePlay.Inst.ifCouldClick) {
             return;
         }
         else {
-            Game.Inst.ifCouldClick = false;
+            GamePlay.Inst.ifCouldClick = false;
         }
 
         //LogUtil.log("Game.Inst.cellItemDic", Game.Inst.cellItemDic, this.x, this.y);
 
         //重置提示
-        Game.Inst.intervalShowGuide();
+        GamePlay.Inst.intervalShowGuide();
 
-        if (Game.Inst.node_changeCellItemUI.active) {
-            Game.Inst.node_changeCellItemUI.active = false;
+        if (GamePlay.Inst.node_changeCellItemUI.active) {
+            GamePlay.Inst.node_changeCellItemUI.active = false;
         }
 
         //重置
-        Game.Inst.cleanedVecArr = [];
-        Game.Inst.cleanXIndexArr = [];
+        GamePlay.Inst.cleanedVecArr = [];
+        GamePlay.Inst.cleanXIndexArr = [];
 
         //更改颜色道具
-        if (Game.Inst.curPropType == PROPTYPE.Change) {
+        if (GamePlay.Inst.curPropType == PROPTYPE.Change) {
 
-            Game.Inst.curPropType = PROPTYPE.Null;
+            GamePlay.Inst.curPropType = PROPTYPE.Null;
 
-            Game.Inst.curSelectCellItem = this;
-            Game.Inst.showChangeCellItemUI();
+            GamePlay.Inst.curSelectCellItem = this;
+            GamePlay.Inst.showChangeCellItemUI();
             this.node.opacity = 150;
             return;
         }
         //锤子道具
-        else if (Game.Inst.curPropType == PROPTYPE.Hammer) {
-            Game.Inst.curPropType = PROPTYPE.Null;
-            Game.Inst.curSelectCellItem = this;
+        else if (GamePlay.Inst.curPropType == PROPTYPE.Hammer) {
+            GamePlay.Inst.curPropType = PROPTYPE.Null;
+            GamePlay.Inst.curSelectCellItem = this;
             let aroundSameTypeNum = GameLogic.getAroundSameType(this.x, this.y, this.type, false).length;
             if (aroundSameTypeNum <= 0) {
                 mk.console.log("周围没有相同的Item ----------------------------------------");
-                Game.Inst.cleanedVecArr.push(new cc.Vec2(this.x, this.y));
+                GamePlay.Inst.cleanedVecArr.push(new cc.Vec2(this.x, this.y));
                 //this.ifRemoved = true;
             }
 
         }
 
-        Game.Inst.curClickCellItem = this;
+        GamePlay.Inst.curClickCellItem = this;
 
         //获取清除的CellItem的位置信息列表
         GameLogic.getCleanedVecList(this.x, this.y, this.type);
 
         //根据vec列表清理cellItem
-        Game.Inst.cleanCellItemByVecList();
+        GamePlay.Inst.cleanCellItemByVecList();
     }
 
     /**
@@ -188,7 +188,7 @@ export default class CellItem extends cc.Component {
         //如果不需要移动就return
         if (this.y == index_y) {
             if (ifLastMoveCellItem) {
-                Game.Inst.checkMoveLeftCellItem();
+                GamePlay.Inst.checkMoveLeftCellItem();
             }
             return;
         }
@@ -200,17 +200,17 @@ export default class CellItem extends cc.Component {
         let intervalNum = index_y - this.y;
 
         //将原来位置置空
-        Game.Inst.cellItemDic[this.x][this.y] = null;
+        GamePlay.Inst.cellItemDic[this.x][this.y] = null;
 
         //重新赋值位置
         this.x = index_x;
         this.y = index_y;
 
         //给现在位置重新赋值
-        Game.Inst.cellItemDic[this.x][this.y] = this;
+        GamePlay.Inst.cellItemDic[this.x][this.y] = this;
 
         //let endX = index_x * this.node.width + this.node.width * 0.5 - Game.Inst.node_content.width * 0.5;
-        let endY = -(this.y * this.node.height + this.node.height * 0.5) + Game.Inst.node_content.height * 0.5;
+        let endY = -(this.y * this.node.height + this.node.height * 0.5) + GamePlay.Inst.node_content.height * 0.5;
 
         let delayTime = moveIndex * 0.03;
         let moveDwonTime = intervalNum * 0.12;
@@ -229,7 +229,7 @@ export default class CellItem extends cc.Component {
 
                     mk.console.log("【CellItem】检测是否能消除 移动完毕最后一个");
 
-                    Game.Inst.checkMoveLeftCellItem();
+                    GamePlay.Inst.checkMoveLeftCellItem();
                     //Game.Inst.ifCouldClick = true;
                 }
             }).start()
@@ -245,16 +245,16 @@ export default class CellItem extends cc.Component {
         }
 
         //将原来位置置空
-        Game.Inst.cellItemDic[this.x][this.y] = null;
+        GamePlay.Inst.cellItemDic[this.x][this.y] = null;
 
         //重新赋值位置
         this.x = index_x;
         this.y = index_y;
 
         //给现在位置重新赋值
-        Game.Inst.cellItemDic[this.x][this.y] = this;
+        GamePlay.Inst.cellItemDic[this.x][this.y] = this;
 
-        let endX = index_x * this.node.width + this.node.width * 0.5 - Game.Inst.node_content.width * 0.5;
+        let endX = index_x * this.node.width + this.node.width * 0.5 - GamePlay.Inst.node_content.width * 0.5;
         //let endY = Game.Inst.node_content.height * 0.5 - index_y * this.node.height + this.node.height * 0.5;
 
         cc.tween(this.node)
@@ -264,9 +264,9 @@ export default class CellItem extends cc.Component {
                     mk.console.log("检测是否能消除!!!!!!!!!!!!!!!!!!!!!!!!!!最后移除"); 
 
                     //先注释 避免重复判断 
-                    Game.Inst.checkIfEliminate();
+                    GamePlay.Inst.checkIfEliminate();
 
-                    Game.Inst.ifCouldClick = true;
+                    GamePlay.Inst.ifCouldClick = true;
                 }
             }).start()
     }
@@ -293,23 +293,23 @@ export default class CellItem extends cc.Component {
 
 
         //这边不置空的话
-        Game.Inst.cellItemDic[this.x][this.y] = null;
+        GamePlay.Inst.cellItemDic[this.x][this.y] = null;
 
         // let index = Game.Inst.cellItemList.indexOf(this);
         // if (index != -1) {
         //     Game.Inst.cellItemList.splice(index, 1);
         // }
 
-        let pos_x = this.node.x + Game.Inst.node_content.x;
-        let pos_y = this.node.y + Game.Inst.node_content.y;
+        let pos_x = this.node.x + GamePlay.Inst.node_content.x;
+        let pos_y = this.node.y + GamePlay.Inst.node_content.y;
 
-        if (Game.Inst.curSelectCellItem == this) {
-            Game.Inst.curSelectCellItem = null;
-            if (Game.Inst.curPropType == PROPTYPE.Hammer) {
-                Game.Inst.curPropType = null;
+        if (GamePlay.Inst.curSelectCellItem == this) {
+            GamePlay.Inst.curSelectCellItem = null;
+            if (GamePlay.Inst.curPropType == PROPTYPE.Hammer) {
+                GamePlay.Inst.curPropType = null;
                 let node_hammer = PoolMgr.Inst.getPoolPrefab(NODEPOOLPREFABTYPE.Hammer);
                 node_hammer.setPosition(pos_x, pos_y);
-                Game.Inst.node_effectUI.addChild(node_hammer);
+                GamePlay.Inst.node_effectUI.addChild(node_hammer);
             }
         }
 
@@ -318,39 +318,39 @@ export default class CellItem extends cc.Component {
             let node_baozha = PoolMgr.Inst.getPoolPrefab(NODEPOOLPREFABTYPE.Baozha);
             node_baozha.x = pos_x;
             node_baozha.y = pos_y;
-            Game.Inst.node_effectUI.addChild(node_baozha);
+            GamePlay.Inst.node_effectUI.addChild(node_baozha);
             node_baozha.getComponent(AniFinishDestroy).init();
 
             //LogUtil.log("10 + Game.Inst.cleanedVecArr.length * 5", 10 + Game.Inst.cleanedVecArr.length * 5);
 
             //得分
-            let score = 10 + Game.Inst.cleanedVecArr.length * 5;
+            let score = 10 + GamePlay.Inst.cleanedVecArr.length * 5;
             //得分特效
             let node_score = PoolMgr.Inst.getPoolPrefab(NODEPOOLPREFABTYPE.EliminateScore);
             //LogUtil.log("node_score", node_score);
-            let x = this.node.x + Game.Inst.node_content.x;
-            let y = this.node.y + Game.Inst.node_content.y + 30;
+            let x = this.node.x + GamePlay.Inst.node_content.x;
+            let y = this.node.y + GamePlay.Inst.node_content.y + 30;
             node_score.getComponent(EliminateScore).init(new cc.Vec2(x, y), score);
-            Game.Inst.node_effectUI.addChild(node_score);
+            GamePlay.Inst.node_effectUI.addChild(node_score);
 
             if (recycleType) {
-                Game.Inst.curGetScore += score;
-                Game.Inst.finalGetScore += score;
-                Game.Inst.initScore();
+                GamePlay.Inst.curGetScore += score;
+                GamePlay.Inst.finalGetScore += score;
+                GamePlay.Inst.initScore();
             }
             else {
                 let node_scoreEnergy = PoolMgr.Inst.getPoolPrefab(NODEPOOLPREFABTYPE.ScoreEnergy);
                 node_scoreEnergy.getComponent(ScoreEnergy).init(x, y, score);
-                Game.Inst.node_effectUI.addChild(node_scoreEnergy);
+                GamePlay.Inst.node_effectUI.addChild(node_scoreEnergy);
 
                 //点击哪一个就在哪个位置生成
-                if (Game.Inst.curClickCellItem == this) {
-                    Game.Inst.curClickCellItem = null;
-                    let eliminateNum = Game.Inst.cleanedVecArr.length;
-                    if (Game.Inst.checkAddLevelRedPacket(eliminateNum)) {
+                if (GamePlay.Inst.curClickCellItem == this) {
+                    GamePlay.Inst.curClickCellItem = null;
+                    let eliminateNum = GamePlay.Inst.cleanedVecArr.length;
+                    if (GamePlay.Inst.checkAddLevelRedPacket(eliminateNum)) {
                         let node_levelRedPacket = PoolMgr.Inst.getPoolPrefab(NODEPOOLPREFABTYPE.LevelRedPacketItem);
                         node_levelRedPacket.setPosition(pos_x, pos_y);
-                        Game.Inst.node_levelRedPacketUI.addChild(node_levelRedPacket);
+                        GamePlay.Inst.node_levelRedPacketUI.addChild(node_levelRedPacket);
                     }
                 }
             }

+ 2 - 2
assets/script/before/view/uiItem/LevelRedPacketItem.ts

@@ -7,7 +7,7 @@
 
 import PoolMgr, { NODEPOOLPREFABTYPE } from "../../mgr/PoolMgr";
 import LevelRedPacketUI from "../LevelRedPacketUI";
-import Game from "../../Game";
+import GamePlay from "../../GamePlay";
 import GameMgr, { UIITEM_NAME, UI_NAME } from "../../mgr/GameMgr";
 
 const { ccclass, property } = cc._decorator;
@@ -34,7 +34,7 @@ export default class LevelRedPacketItem extends cc.Component {
         GameMgr.Inst.sendEvent(UIITEM_NAME.LevelRedPacketItem,"点击随机红包");
        
         mk.ui.openPanel("game/prefab/uiPanel/LevelRedPacketUI").then((node)=>{
-            node.getComponent(LevelRedPacketUI).init(Game.Inst.cleanedVecArr.length);
+            node.getComponent(LevelRedPacketUI).init(GamePlay.Inst.cleanedVecArr.length);
         })
       
         this.recycle();

+ 3 - 3
assets/script/before/view/uiItem/SelectCellItemBtn.ts

@@ -1,4 +1,4 @@
-import Game from "../../Game";
+import GamePlay from "../../GamePlay";
 import GameConst from "../../data/GameConst";
 
 const { ccclass, property } = cc._decorator;
@@ -31,7 +31,7 @@ export default class SelectCellItemBtn extends cc.Component {
     }
 
     onClick() {
-        Game.Inst.node_changeCellItemUI.active = false;
-        Game.Inst.changeCellItemType(this.type);
+        GamePlay.Inst.node_changeCellItemUI.active = false;
+        GamePlay.Inst.changeCellItemType(this.type);
     }
 }