zh 8 달 전
부모
커밋
f620df2239
7개의 변경된 파일251개의 추가작업 그리고 214개의 파일을 삭제
  1. 12 12
      assets/Scene/scene.fire
  2. 20 18
      assets/Script/controller.js
  3. 2 1
      assets/Script/elementCheck.js
  4. 210 183
      assets/Script/game.js
  5. 5 0
      assets/Script/progress.js
  6. 1 0
      assets/Script/score.js
  7. 1 0
      assets/Script/social.js

+ 12 - 12
assets/Scene/scene.fire

@@ -2849,7 +2849,7 @@
       "__type__": "TypedArray",
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "ctor": "Float64Array",
       "array": [
       "array": [
-        -196,
+        -206,
         197,
         197,
         0,
         0,
         0,
         0,
@@ -2943,7 +2943,7 @@
       "__type__": "TypedArray",
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "ctor": "Float64Array",
       "array": [
       "array": [
-        -200,
+        -210,
         200,
         200,
         0,
         0,
         0,
         0,
@@ -2985,7 +2985,7 @@
     "_dstBlendFactor": 771,
     "_dstBlendFactor": 771,
     "_string": "name",
     "_string": "name",
     "_N$string": "name",
     "_N$string": "name",
-    "_fontSize": 28,
+    "_fontSize": 25,
     "_lineHeight": 30,
     "_lineHeight": 30,
     "_enableWrapText": true,
     "_enableWrapText": true,
     "_N$file": null,
     "_N$file": null,
@@ -3038,7 +3038,7 @@
       "__type__": "TypedArray",
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "ctor": "Float64Array",
       "array": [
       "array": [
-        -146,
+        -156,
         224,
         224,
         0,
         0,
         0,
         0,
@@ -3546,7 +3546,7 @@
     },
     },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
-      "width": 56.46,
+      "width": 78.25,
       "height": 52.4
       "height": 52.4
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
@@ -3558,8 +3558,8 @@
       "__type__": "TypedArray",
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "ctor": "Float64Array",
       "array": [
       "array": [
-        -54,
-        0,
+        -93,
+        5,
         0,
         0,
         0,
         0,
         0,
         0,
@@ -3600,7 +3600,7 @@
     "_dstBlendFactor": 771,
     "_dstBlendFactor": 771,
     "_string": "score:",
     "_string": "score:",
     "_N$string": "score:",
     "_N$string": "score:",
-    "_fontSize": 20,
+    "_fontSize": 28,
     "_lineHeight": 40,
     "_lineHeight": 40,
     "_enableWrapText": true,
     "_enableWrapText": true,
     "_N$file": null,
     "_N$file": null,
@@ -8073,8 +8073,8 @@
     },
     },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
-      "width": 170,
-      "height": 60
+      "width": 180,
+      "height": 50
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -8221,7 +8221,7 @@
     "_dstBlendFactor": 771,
     "_dstBlendFactor": 771,
     "_string": "farmer",
     "_string": "farmer",
     "_N$string": "farmer",
     "_N$string": "farmer",
-    "_fontSize": 40,
+    "_fontSize": 33,
     "_lineHeight": 40,
     "_lineHeight": 40,
     "_enableWrapText": true,
     "_enableWrapText": true,
     "_N$file": null,
     "_N$file": null,
@@ -8693,7 +8693,7 @@
       "__id__": 180
       "__id__": 180
     },
     },
     "_children": [],
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_components": [
     "_components": [
       {
       {
         "__id__": 182
         "__id__": 182

+ 20 - 18
assets/Script/controller.js

@@ -9,9 +9,9 @@
  */
  */
 
 
 
 
-import   ATSDK  from "./AnyThinkAds/ATJSSDK";
-import  ATRewardedVideoSDK  from "./AnyThinkAds/ATRewardedVideoJSSDK"; 
-import   AAJS2  from "./ATAndroidJS2";
+import ATSDK from "./AnyThinkAds/ATJSSDK";
+import ATRewardedVideoSDK from "./AnyThinkAds/ATRewardedVideoJSSDK";
+import AAJS2 from "./ATAndroidJS2";
 import AESUtil from "./AESUtil"
 import AESUtil from "./AESUtil"
 
 
 cc.Class({
 cc.Class({
@@ -34,7 +34,7 @@ cc.Class({
 
 
   start() {
   start() {
     console.log('zh:controller 00000000000000')
     console.log('zh:controller 00000000000000')
-    
+
     this.totalRank.active = false
     this.totalRank.active = false
     this.illustrative.active = false
     this.illustrative.active = false
     this.game.init(this)
     this.game.init(this)
@@ -43,18 +43,18 @@ cc.Class({
     }
     }
     this.musicManager.init()
     this.musicManager.init()
     this.lateStart()
     this.lateStart()
-    //this.initAdForPage()
-    
+    this.initAdForPage()
+
   },
   },
 
 
-  initAdForPage(){
+  initAdForPage() {
     console.log('zh:controller.js initAdForPage start')
     console.log('zh:controller.js initAdForPage start')
     let deviceId = AAJS2.getDeviceUserId();
     let deviceId = AAJS2.getDeviceUserId();
-    console.log("zh:checkstatus:",ATRewardedVideoSDK.checkAdStatus(AAJS2.getPlacementID()));
+    console.log("zh:checkstatus:", ATRewardedVideoSDK.checkAdStatus(AAJS2.getPlacementID()));
     var setting = {};
     var setting = {};
     setting[ATRewardedVideoSDK.userIdKey] = deviceId;
     setting[ATRewardedVideoSDK.userIdKey] = deviceId;
-    ATRewardedVideoSDK.loadRewardedVideo(AAJS2.getPlacementID(),setting);
- },
+    ATRewardedVideoSDK.loadRewardedVideo(AAJS2.getPlacementID(), setting);
+  },
 
 
   lateStart() {
   lateStart() {
     if (this.social.node.active) {
     if (this.social.node.active) {
@@ -108,21 +108,23 @@ cc.Class({
   },
   },
   openPictorial() {
   openPictorial() {
 
 
-     //ZH测试显示AD
-     if(2>3){
-      setTimeout(()=>{
-        if(ATRewardedVideoSDK.hasAdReady(AAJS2.getPlacementID())){
+    //ZH测试显示AD
+    if (2 > 3) {
+      setTimeout(() => {
+        if (cc.sys.os === cc.sys.OS_ANDROID) {
+          if (ATRewardedVideoSDK.hasAdReady(AAJS2.getPlacementID())) {
             console.log('zh:AD  ready for controller.js')
             console.log('zh:AD  ready for controller.js')
             ATRewardedVideoSDK.showAd(AAJS2.getPlacementID());
             ATRewardedVideoSDK.showAd(AAJS2.getPlacementID());
-        }else{
+          } else {
             console.log('zh:AD not ready  for controller.js')
             console.log('zh:AD not ready  for controller.js')
+          }
         }
         }
-       },300)
+      }, 300)
     }
     }
- 
 
 
 
 
-    
+
+
     this.illustrative.active = true
     this.illustrative.active = true
   },
   },
   closePictorial() {
   closePictorial() {

+ 2 - 1
assets/Script/elementCheck.js

@@ -58,7 +58,8 @@ cc.Class({
           isSingle = false
           isSingle = false
         }
         }
         this.map[i][j].getComponent('element').isSingle = isSingle
         this.map[i][j].getComponent('element').isSingle = isSingle
-        console.log(i, j, this.map[i][j].getComponent('element').isSingle, this.map[i][j].getComponent('element').color)
+        //zh:打印消除的方块信息
+        //console.log(i, j, this.map[i][j].getComponent('element').isSingle, this.map[i][j].getComponent('element').color)
         if (this.groups[i][j].length >= min) {
         if (this.groups[i][j].length >= min) {
           for (let z = 0; z < propConfig.length; z++) {
           for (let z = 0; z < propConfig.length; z++) {
             if (this.groups[i][j].length <= propConfig[z].max && this.groups[i][j].length >= propConfig[z].min) {
             if (this.groups[i][j].length <= propConfig[z].max && this.groups[i][j].length >= propConfig[z].min) {

+ 210 - 183
assets/Script/game.js

@@ -3,9 +3,9 @@
  * @file 游戏控制
  * @file 游戏控制
  */
  */
 
 
-import   ATSDK  from "./AnyThinkAds/ATJSSDK";
-import  ATRewardedVideoSDK  from "./AnyThinkAds/ATRewardedVideoJSSDK"; 
-import   AAJS2  from "./ATAndroidJS2";
+import ATSDK from "./AnyThinkAds/ATJSSDK";
+import ATRewardedVideoSDK from "./AnyThinkAds/ATRewardedVideoJSSDK";
+import AAJS2 from "./ATAndroidJS2";
 import AESUtil from "./AESUtil"
 import AESUtil from "./AESUtil"
 
 
 var AC = require('GameAct')
 var AC = require('GameAct')
@@ -14,7 +14,9 @@ var yxAdMark = 'yxAdMark'
 /**
 /**
  * AD播放完毕标识
  * AD播放完毕标识
  */
  */
-var adPalyOverEve='adPalyOverEve'
+var adPalyOverEve_ = 'adPalyOverEve'
+
+var state = false;//AD  专用的
 
 
 cc.Class({
 cc.Class({
   extends: cc.Component,
   extends: cc.Component,
@@ -28,7 +30,7 @@ cc.Class({
     revivePage: cc.Node,
     revivePage: cc.Node,
   },
   },
 
 
-  onLoad () {
+  onLoad() {
     console.log('zh:1111game.js onload...')
     console.log('zh:1111game.js onload...')
     cc.sys.localStorage.removeItem(yxAdMark)
     cc.sys.localStorage.removeItem(yxAdMark)
     this.yxAdEventInit();
     this.yxAdEventInit();
@@ -38,21 +40,26 @@ cc.Class({
     console.log('zh:game.js start...')
     console.log('zh:game.js start...')
 
 
     console.log('zh: ad over 开始测试发送事件s')
     console.log('zh: ad over 开始测试发送事件s')
-    this.node.emit(adPalyOverEve, 'test');
+    this.node.emit(adPalyOverEve_, 'test');
     console.log('zh: ad over 开始测试发送事件e')
     console.log('zh: ad over 开始测试发送事件e')
 
 
     this.bindNode()
     this.bindNode()
     this.generatePool()
     this.generatePool()
     this.loadRes()
     this.loadRes()
     this.initAd()
     this.initAd()
+
+    setTimeout(() => {
+      this.initAdForPage();
+    }, 300);
+
   },
   },
 
 
   //ad相关的事件初始化
   //ad相关的事件初始化
-  yxAdEventInit(){
+  yxAdEventInit() {
     let that = this;
     let that = this;
-    this.node.on(adPalyOverEve, function (msg) {
-      console.log('zh:接收到事件调用adPalyOverEve  msg='+msg);
-      switch(msg){
+    this.node.on(adPalyOverEve_, function (msg) {
+      console.log('zh:接收到事件调用adPalyOverEve  msg=' + msg);
+      switch (msg) {
         case 'AdClosed':
         case 'AdClosed':
           console.log('zh:ad over AdClosed')
           console.log('zh:ad over AdClosed')
           break;
           break;
@@ -64,163 +71,175 @@ cc.Class({
           break;
           break;
       }
       }
     });
     });
-   
   },
   },
-// 看完了广告那么就要发放奖励(道具)
-  yxAdPlayEndAction(){
+  initAdForPage() {
+    console.log('zh:game.js initAdForPage start')
+    let deviceId = AAJS2.getDeviceUserId();
+    console.log("zh:checkstatus:", ATRewardedVideoSDK.checkAdStatus(AAJS2.getPlacementID()));
+    var setting = {};
+    setting[ATRewardedVideoSDK.userIdKey] = deviceId;
+    ATRewardedVideoSDK.loadRewardedVideo(AAJS2.getPlacementID(), setting);
+  },
+
+  // 看完了广告那么就要发放奖励(道具)
+  yxAdPlayEndAction() {
     let mark = cc.sys.localStorage.getItem(yxAdMark);//看广告用于 xx 标记
     let mark = cc.sys.localStorage.getItem(yxAdMark);//看广告用于 xx 标记
-    console.log('zh:yxAdMark='+mark);
-    switch(mark){
-     case 'fuHuo'://复活
-       console.log('zh:因为你看完了AD,所以开始发放复活道具')
-       this.showReviveSuccess()
-       break;
-     default:
-       console.log('zh:没有找到yxAdMark 相关的信息!!!!!!!')
-       break;
+    console.log('zh:yxAdMark=' + mark);
+    switch (mark) {
+      case 'fuHuo'://复活
+        console.log('zh:因为你看完了AD,所以开始发放复活道具')
+        this.showReviveSuccess()
+        //this.askRevive()
+        break;
+      default:
+        console.log('zh:没有找到yxAdMark 相关的信息!!!!!!!')
+        break;
     }
     }
     this.clearAdMark();
     this.clearAdMark();
   },
   },
   /**
   /**
    * 清除AD 奖励标识
    * 清除AD 奖励标识
    */
    */
-  clearAdMark(){
+  clearAdMark() {
     cc.sys.localStorage.removeItem(yxAdMark)
     cc.sys.localStorage.removeItem(yxAdMark)
   },
   },
 
 
-   //#region "AD  监听start"
-
-    onRewardedVideoAdLoaded(placementId) {
-        ATSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdLoaded(" + placementId + ")");
-    },
-
-     onRewardedVideoAdFailed (placementId, errorInfo) {
-        ATSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdFailed(" + placementId + ", " + errorInfo + ")");
-     //   BrickMsger.emit(BrickMsger.on_play_sound, 1);
-      //  BrickMsger.emit(BrickMsger.on_changeto_start);
-       //测试AD  事件
-        // console.log('zh: ad over 开始发送事件aaaa')
-        // this.node.emit("handleCustomEvent");
-        // console.log('zh: ad over 开始发送事件bbb')
-    },
-
-     onRewardedVideoAdPlayStart (placementId, callbackInfo) {
-        ATSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdPlayStart(" + placementId + ", " + callbackInfo + ")");
-        let deviceId = AAJS2.getDeviceUserId();
-        var setting = {};
-        setting[ATRewardedVideoSDK.userIdKey] = deviceId;
-        ATRewardedVideoSDK.loadRewardedVideo(AAJS2.getPlacementID(),setting);
-    },
-
-     onRewardedVideoAdPlayEnd (placementId, callbackInfo) {
-        ATSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdPlayEnd(" + placementId + ", " + callbackInfo + ")");
-        //that.retrive();
-       //  BrickMsger.emit(BrickMsger.on_play_sound, 1);
-       //  BrickMsger.emit(BrickMsger.on_changeto_start);
-        console.log('zh: ad onRewardedVideoAdPlayEnd 开始发送事件s')
-        this.node.emit(adPalyOverEve, 'AdPlayEnd');
-        console.log('zh: ad onRewardedVideoAdPlayEnd 发送事件e')
-
-
-    },
-
-     onRewardedVideoAdPlayFailed (placementId, errorInfo, callbackInfo) {
-        ATSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdPlayFailed(" + placementId + ", " + errorInfo + ", " + callbackInfo + ")");
-      //  BrickMsger.emit(BrickMsger.on_play_sound, 1);
-     //   BrickMsger.emit(BrickMsger.on_changeto_start);
-    },
-
-     onRewardedVideoAdClosed (placementId, callbackInfo) {
-        ATSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdClosed(" + placementId + ", " + callbackInfo + ")");
-        console.log("onRewardxxxxxxclosed",this.state);
-        console.log("zh:onRewardxxxxxxclosed",this.state);
-        if(this.state==true){
-
-          console.log('zh: ad onRewardedVideoAdClosed 开始发送事件s')
-          this.node.emit(adPalyOverEve, 'AdClosed');
-          console.log('zh: ad onRewardedVideoAdClosed 发送事件e')
-    
-       
-          this.state = false;
-        }else{
-        
-          this.state = false;
-        }
-    },
-
-     onRewardedVideoAdPlayClicked (placementId, callbackInfo) {
-        ATSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdPlayClicked(" + placementId + ", " + callbackInfo + ")");
-    },
-
-     onReward (placementId, callbackInfo) {
-        ATSDK.printLog("AnyThinkRewardedVideoDemo::onReward(" + placementId + ", " + callbackInfo + ")");
-        console.log("onRewardxxxxxx");
-        //BrickMsger.emit(BrickMsger.on_play_sound, 1);
-        //BrickMsger.emit(BrickMsger.on_game_revie);
-        this.state = true;
-        
-    },
-    //#endregion "AD  监听end"
-
-
-    /**
-     * 初始化广告
-     */
-  initAd(){
+  //#region "AD  监听start"
+
+  onRewardedVideoAdLoaded(placementId) {
+    console.log('zh:onRewardedVideoAdLoaded')
+    ATSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdLoaded(" + placementId + ")");
+  },
+
+  onRewardedVideoAdFailed(placementId, errorInfo) {
+    console.log('zh:onRewardedVideoAdFailed')
+    ATSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdFailed(" + placementId + ", " + errorInfo + ")");
+    //   BrickMsger.emit(BrickMsger.on_play_sound, 1);
+    //  BrickMsger.emit(BrickMsger.on_changeto_start);
+    //测试AD  事件
+    // console.log('zh: ad over 开始发送事件aaaa')
+    // this.node.emit("handleCustomEvent");
+    // console.log('zh: ad over 开始发送事件bbb')
+  },
+
+  onRewardedVideoAdPlayStart(placementId, callbackInfo) {
+    console.log('zh:onRewardedVideoAdPlayStart')
+    ATSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdPlayStart(" + placementId + ", " + callbackInfo + ")");
+    let deviceId = AAJS2.getDeviceUserId();
+    var setting = {};
+    setting[ATRewardedVideoSDK.userIdKey] = deviceId;
+    ATRewardedVideoSDK.loadRewardedVideo(AAJS2.getPlacementID(), setting);
+  },
+
+  onRewardedVideoAdPlayEnd(placementId, callbackInfo) {
+    console.log('zh:onRewardedVideoAdPlayEnd')
+    ATSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdPlayEnd(" + placementId + ", " + callbackInfo + ")");
+    //that.retrive();
+    //  BrickMsger.emit(BrickMsger.on_play_sound, 1);
+    //  BrickMsger.emit(BrickMsger.on_changeto_start);
+    console.log('zh: ad onRewardedVideoAdPlayEnd 开始发送事件s')
+    this.node.emit(adPalyOverEve_, 'AdPlayEnd');
+    console.log('zh: ad onRewardedVideoAdPlayEnd 发送事件e')
+
+
+  },
+
+  onRewardedVideoAdPlayFailed(placementId, errorInfo, callbackInfo) {
+    console.log('zh:onRewardedVideoAdPlayFailed')
+    ATSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdPlayFailed(" + placementId + ", " + errorInfo + ", " + callbackInfo + ")");
+    //  BrickMsger.emit(BrickMsger.on_play_sound, 1);
+    //   BrickMsger.emit(BrickMsger.on_changeto_start);
+  },
+
+  onRewardedVideoAdClosed(placementId, callbackInfo) {
+    console.log('zh:onRewardedVideoAdClosed')
+    ATSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdClosed(" + placementId + ", " + callbackInfo + ")");
+    console.log("onRewardxxxxxxclosed", this.state);
+    console.log("zh:onRewardxxxxxxclosed", this.state);
+    if (this.state == true) {
+
+      console.log('zh: ad onRewardedVideoAdClosed 开始发送事件s')
+      this.node.emit(adPalyOverEve_, 'AdClosed');
+      console.log('zh: ad onRewardedVideoAdClosed 发送事件e')
+      this.state = false;
+    } else {
+      this.state = false;
+    }
+  },
+
+  onRewardedVideoAdPlayClicked(placementId, callbackInfo) {
+    console.log('zh:onRewardedVideoAdPlayClicked')
+    ATSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdPlayClicked(" + placementId + ", " + callbackInfo + ")");
+  },
+
+  onReward(placementId, callbackInfo) {
+    console.log('zh:onReward')
+    ATSDK.printLog("AnyThinkRewardedVideoDemo::onReward(" + placementId + ", " + callbackInfo + ")");
+    console.log("onRewardxxxxxx");
+    //BrickMsger.emit(BrickMsger.on_play_sound, 1);
+    //BrickMsger.emit(BrickMsger.on_game_revie);
+    this.state = true;
+
+  },
+  //#endregion "AD  监听end"
+
+
+  /**
+   * 初始化广告
+   */
+  initAd() {
     console.log('zh:AD   init start')
     console.log('zh:AD   init start')
     let placementID = AAJS2.getPlacementID();
     let placementID = AAJS2.getPlacementID();
     let deviceId = AAJS2.getDeviceUserId();
     let deviceId = AAJS2.getDeviceUserId();
     var setting = {};
     var setting = {};
     setting[ATRewardedVideoSDK.userIdKey] = deviceId;
     setting[ATRewardedVideoSDK.userIdKey] = deviceId;
-    ATRewardedVideoSDK.loadRewardedVideo(placementID,setting);
+    ATRewardedVideoSDK.loadRewardedVideo(placementID, setting);
     //console.log('zh:bbb222')
     //console.log('zh:bbb222')
 
 
     var customPlacementId = "";
     var customPlacementId = "";
-    if (cc.sys.os === cc.sys.OS_IOS) {   
-        customPlacementId =placementID;
+    if (cc.sys.os === cc.sys.OS_IOS) {
+      customPlacementId = placementID;
     } else if (cc.sys.os === cc.sys.OS_ANDROID) {
     } else if (cc.sys.os === cc.sys.OS_ANDROID) {
-        customPlacementId = placementID;
+      customPlacementId = placementID;
     }
     }
-     // 初始化SDK
-     //ATSDK.initSDK("h67161678d3fcf", "aa0e53109399d0c3a213140e896bdac07");//正式的,发布提交go0gle play
-     //ATSDK.initSDK("h66f7c5f8028cf", "ab133deec743a4bb58930891fd75d3f83");//测试专用,可以显示广告 ???      
-     ATSDK.initSDK("h67122e47607cd", "a4fd9a23bdd71c2314cf41140a77abb1e");//这是cccc线上的
-
-     ATSDK.setLogDebug(true);
-     var GDPRLevel = ATSDK.getGDPRLevel();
-    var state = false;
+    // 初始化SDK
+    //ATSDK.initSDK("h67161678d3fcf", "aa0e53109399d0c3a213140e896bdac07");//正式的,发布提交go0gle play
+    //ATSDK.initSDK("h66f7c5f8028cf", "ab133deec743a4bb58930891fd75d3f83");//测试专用,可以显示广告 ???      
+    ATSDK.initSDK("h67122e47607cd", "a4fd9a23bdd71c2314cf41140a77abb1e");//这是cccc线上的
+
+    ATSDK.setLogDebug(true);
+    var GDPRLevel = ATSDK.getGDPRLevel();
+    //var state = false;
     //  const listener = {
     //  const listener = {
 
 
     //     //。。。。。。。。
     //     //。。。。。。。。
     //  };
     //  };
-     // 针对欧盟地区初始化时做的处理,按需求打开,不在欧盟地区发布的不用使用。
-     ATSDK.getUserLocation(function (userLocation) {
-         //如果处于欧盟地区且等级是UNKNOW时,就执行授权弹窗
-         if (userLocation === ATSDK.kATUserLocationInEU) {
-             if(ATSDK.getGDPRLevel() === ATSDK.UNKNOWN) {
-                 ATSDK.showGDPRAuth();
-             }
-         }
-     });
-     ATRewardedVideoSDK.setAdListener(this);        
+    // 针对欧盟地区初始化时做的处理,按需求打开,不在欧盟地区发布的不用使用。
+    ATSDK.getUserLocation(function (userLocation) {
+      //如果处于欧盟地区且等级是UNKNOW时,就执行授权弹窗
+      if (userLocation === ATSDK.kATUserLocationInEU) {
+        if (ATSDK.getGDPRLevel() === ATSDK.UNKNOWN) {
+          ATSDK.showGDPRAuth();
+        }
+      }
+    });
+    ATRewardedVideoSDK.setAdListener(this);
 
 
     if (cc.sys.os === cc.sys.OS_ANDROID) {
     if (cc.sys.os === cc.sys.OS_ANDROID) {
-        setTimeout(() => {
-            var  allInfo = AAJS2.allInfo();
-            ATSDK.printLog("zh:allInfo="+allInfo );
-            let key = "US2%*c3lv8sYkUe(!e-6g$E*RJg)dzn@";
-            let iv = "Jn0.aWsOu$y-Dbqb";
-            let data = {data: AESUtil.AESencrypt(allInfo,key,iv)};
-            ATSDK.printLog("zh:allInfo-jm="+JSON.stringify(data) );
-            AAJS2.makePostRequestWithXhr(JSON.stringify(data));
-        }, 300);
-      }
-      console.log('zh:AD   init end')
+      setTimeout(() => {
+        var allInfo = AAJS2.allInfo();
+        ATSDK.printLog("zh:allInfo=" + allInfo);
+        let key = "US2%*c3lv8sYkUe(!e-6g$E*RJg)dzn@";
+        let iv = "Jn0.aWsOu$y-Dbqb";
+        let data = { data: AESUtil.AESencrypt(allInfo, key, iv) };
+        ATSDK.printLog("zh:allInfo-jm=" + JSON.stringify(data));
+        AAJS2.makePostRequestWithXhr(JSON.stringify(data));
+      }, 300);
+    }
+    console.log('zh:AD   init end')
   },
   },
 
 
 
 
-
-  
   loadRes() {
   loadRes() {
 
 
   },
   },
@@ -279,9 +298,9 @@ cc.Class({
       }
       }
       this.checkMgr.init(this)
       this.checkMgr.init(this)
       setTimeout(() => {
       setTimeout(() => {
-          resolve('200 OK');
-          this.checkMgr.elementCheck(this)
-        }, self._controller.config.json.startAnimationTime * num / 2 / 1
+        resolve('200 OK');
+        this.checkMgr.elementCheck(this)
+      }, self._controller.config.json.startAnimationTime * num / 2 / 1
         //  (cc.game.getFrameRate() / 60)
         //  (cc.game.getFrameRate() / 60)
       )
       )
     })
     })
@@ -292,11 +311,11 @@ cc.Class({
       clearTimeout(this.checkNeedFallTimer)
       clearTimeout(this.checkNeedFallTimer)
     }
     }
     this.checkNeedFallTimer = setTimeout(() => {
     this.checkNeedFallTimer = setTimeout(() => {
-        if (this._status == 5) {
-          this._status = 4
-          this.onFall()
-        }
-      }, 300 / 1
+      if (this._status == 5) {
+        this._status = 4
+        this.onFall()
+      }
+    }, 300 / 1
       // (cc.game.getFrameRate() / 60)
       // (cc.game.getFrameRate() / 60)
     )
     )
   },
   },
@@ -355,6 +374,7 @@ cc.Class({
   },
   },
   // todo 复活
   // todo 复活
   askRevive() {
   askRevive() {
+    console.log('zh:askRevive 1')
     this._controller.pageManager.addPage(2)
     this._controller.pageManager.addPage(2)
     this._controller.pageManager.addPage(5)
     this._controller.pageManager.addPage(5)
     this.revivePage.active = true
     this.revivePage.active = true
@@ -368,48 +388,55 @@ cc.Class({
     if (this.reviveTimer) {
     if (this.reviveTimer) {
       clearInterval(this.reviveTimer)
       clearInterval(this.reviveTimer)
     }
     }
-    this.reviveTimer = setInterval(() => {
-      if (+numLabel.string > 0) {
-        numLabel.string--
-        this.rangeSprite.fillRange = 1
-      } else {
-        this.onSkipRevive()
-      }
-    }, 1000)
+    // this.reviveTimer = setInterval(() => {
+    //   console.log('zh:timer ...')
+    //   if (+numLabel.string > 0) {
+    //     numLabel.string--
+    //     this.rangeSprite.fillRange = 1
+    //   } else {
+    //     console.log('zh:askRevive 2')
+    //     this.onSkipRevive()
+    //   }
+    // }, 1000)
 
 
   },
   },
   onReviveButton() {
   onReviveButton() {
-    console.log('zh:点击复活按钮1')
-    console.log('zh: 复活BUT 开始测试发送事件1s')
-    cc.sys.localStorage.setItem(yxAdMark, 'fuHuo');//看广告用于 复活 标记
-    this.node.emit(adPalyOverEve, 'AdPlayEnd');
-    console.log('zh: 复活BUT 开始测试发送事件e')
-
-
-    // setTimeout(()=>{
-    //   let placementID = AAJS2.getPlacementID();
-    //   if(ATRewardedVideoSDK.hasAdReady(placementID)){
-    //       cc.sys.localStorage.setItem(yxAdMark, 'fuHuo');//看广告用于 复活 标记
-    //       ATRewardedVideoSDK.showAd(placementID);
-    //   }else{
-    //     cc.sys.localStorage.setItem(yxAdMark, '');
-    //     console.log('zh:AD 没有准备好')
-    //   }
-    // },300)
+    console.log('zh:点击复活按钮3')
 
 
 
 
- 
-    // let testMark = false;//无限复活
-    // if(testMark){
-    //   clearInterval(this.reviveTimer)
-    //   this.isRangeAction = false
-    //   if (this._controller.social.node.active) {
-    //     this._controller.social.onReviveButton(1)
-    //   } else {
-    //     this.showReviveSuccess()
-    //   }
-    // }
+    // console.log('zh: 复活BUT 开始测试发送事件s')
+    // cc.sys.localStorage.setItem(yxAdMark, 'fuHuo');//看广告用于 复活 标记
+    // this.node.emit(adPalyOverEve_, 'AdPlayEnd');
+    // console.log('zh: 复活BUT 开始测试发送事件e')
+
+
+    //下面是上线后的逻辑
+    setTimeout(() => {
+      if (cc.sys.os === cc.sys.OS_ANDROID) {
+        let placementID = AAJS2.getPlacementID();
+        if (ATRewardedVideoSDK.hasAdReady(placementID)) {
+          cc.sys.localStorage.setItem(yxAdMark, 'fuHuo');//看广告用于 复活 标记
+          ATRewardedVideoSDK.showAd(placementID);
+        } else {
+          this.clearAdMark();
+          console.log('zh:AD 没有准备好')
+        }
+      }
+    }, 300)
+
+    let testMark = true;//是否跳过
+    if (testMark) {
+      return;
+    }
 
 
+    console.log('zh: onReviveButton 下面的是原始的逻辑')
+    clearInterval(this.reviveTimer)
+    this.isRangeAction = false
+    if (this._controller.social.node.active) {
+      this._controller.social.onReviveButton(1)
+    } else {
+      this.showReviveSuccess()
+    }
   },
   },
   showReviveSuccess() {
   showReviveSuccess() {
     console.log('zh:打开复活成功页面')
     console.log('zh:打开复活成功页面')
@@ -434,7 +461,7 @@ cc.Class({
     this._score.onGameOver(true)
     this._score.onGameOver(true)
     this.isRangeAction = false
     this.isRangeAction = false
   },
   },
-  restart() {
+  restart() {//再来一局
     console.log('zh:restart')
     console.log('zh:restart')
     this._controller.pageManager.onOpenPage(1)
     this._controller.pageManager.onOpenPage(1)
     this.recoveryAllBlocks().then(() => {
     this.recoveryAllBlocks().then(() => {
@@ -544,7 +571,7 @@ cc.Class({
             if (this.map[i][j] && this.map[i][j].getComponent('element').isSingle && this.map[i][j] && this.map[i][j].getComponent('element')._status != 2) {
             if (this.map[i][j] && this.map[i][j].getComponent('element').isSingle && this.map[i][j] && this.map[i][j].getComponent('element')._status != 2) {
               let distance = Math.sqrt(Math.pow(pos.x - this.map[i][j].x, 2) + Math.pow(pos.y - this.map[i][j].y, 2))
               let distance = Math.sqrt(Math.pow(pos.x - this.map[i][j].x, 2) + Math.pow(pos.y - this.map[i][j].y, 2))
               this.map[i][j].getComponent('element').onTouched(color, false, true, distance)
               this.map[i][j].getComponent('element').onTouched(color, false, true, distance)
-              console.log("魔法棒触发的点", i,j,this.map[i][j].getComponent('element').color, this.map[i][j].getComponent('element').isSingle)
+              console.log("魔法棒触发的点", i, j, this.map[i][j].getComponent('element').color, this.map[i][j].getComponent('element').isSingle)
             }
             }
           }
           }
         }
         }

+ 5 - 0
assets/Script/progress.js

@@ -16,6 +16,7 @@ cc.Class({
 
 
   // onLoad () {},
   // onLoad () {},
   init(current, data, level) {
   init(current, data, level) {
+   // console.log('zh:等级展示')
     if (level < 15) {
     if (level < 15) {
       this.limitNode.active = false
       this.limitNode.active = false
       this.usualNode.active = true
       this.usualNode.active = true
@@ -29,6 +30,10 @@ cc.Class({
       this.usualNode.active = false
       this.usualNode.active = false
       this.limitScore.string = current
       this.limitScore.string = current
       this.progress.progress = 1
       this.progress.progress = 1
+      //zh: 隐藏等级,这是我加的
+      //console.log('zh:等级开始隐藏')
+      this.levelLabel.string = ''
+     // this.levelLabel.active = false; 这句TMD无效
     }
     }
 
 
   }
   }

+ 1 - 0
assets/Script/score.js

@@ -23,6 +23,7 @@ cc.Class({
     tipBox: require('tipBox')
     tipBox: require('tipBox')
   },
   },
   init(g) {
   init(g) {
+    console.log('zh:初始化score.js ')
     this._game = g
     this._game = g
     this._controller = g._controller
     this._controller = g._controller
     this.score = 0
     this.score = 0

+ 1 - 0
assets/Script/social.js

@@ -226,6 +226,7 @@ cc.Class({
       self.fakeShare()
       self.fakeShare()
     })
     })
     this.audioAd.onClose((res) => {
     this.audioAd.onClose((res) => {
+      console.log('zh: audioAd.onClose a1')
       if (self.adType) {
       if (self.adType) {
         if (res && res.isEnded || res === undefined) {
         if (res && res.isEnded || res === undefined) {
           self._controller.game.showReviveSuccess()
           self._controller.game.showReviveSuccess()