Explorar el Código

增加无广告配置
口罩玩法,金币随机数
口罩玩法,正确、错误音效

future hace 1 año
padre
commit
1a44f7e4c5

+ 4 - 4
assets/resources/prefabs/game_play_zhao_bu_tong.prefab

@@ -465,7 +465,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 8.8984375,
+      "width": 8.896250229473262,
       "height": 20.16
     },
     "_anchorPoint": {
@@ -504,7 +504,7 @@
     "_string": "0",
     "_horizontalAlign": 0,
     "_verticalAlign": 1,
-    "_actualFontSize": 16,
+    "_actualFontSize": 20.334975369458128,
     "_fontSize": 16,
     "_fontFamily": "Arial",
     "_lineHeight": 16,
@@ -1142,7 +1142,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 140,
+      "width": 139.95191287255102,
       "height": 25.2
     },
     "_anchorPoint": {
@@ -1181,7 +1181,7 @@
     "_string": "找出谁没戴口罩",
     "_horizontalAlign": 1,
     "_verticalAlign": 1,
-    "_actualFontSize": 20,
+    "_actualFontSize": 25.418719211822662,
     "_fontSize": 20,
     "_fontFamily": "Arial",
     "_lineHeight": 20,

+ 4 - 4
assets/scene/game.scene

@@ -714,7 +714,7 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 8.895066879734848,
+      "width": 8.896250229473262,
       "height": 20.16
     },
     "_anchorPoint": {
@@ -747,7 +747,7 @@
     "_string": "0",
     "_horizontalAlign": 0,
     "_verticalAlign": 1,
-    "_actualFontSize": 19.507389162561577,
+    "_actualFontSize": 20.334975369458128,
     "_fontSize": 16,
     "_fontFamily": "Arial",
     "_lineHeight": 16,
@@ -2623,7 +2623,7 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 87.48525353633997,
+      "width": 87.50582081402919,
       "height": 25.2
     },
     "_anchorPoint": {
@@ -2656,7 +2656,7 @@
     "_string": "加载中50%...",
     "_horizontalAlign": 1,
     "_verticalAlign": 1,
-    "_actualFontSize": 18.288177339901477,
+    "_actualFontSize": 19.064039408866996,
     "_fontSize": 15,
     "_fontFamily": "Arial",
     "_lineHeight": 20,

+ 1 - 0
assets/script/config.ts

@@ -7,6 +7,7 @@ export class config {
     static static_domain = config.debug ? "https://zcapi.xwrun.com" : "https://zaoca.oss-cn-beijing.aliyuncs.com";
     static statistics_domain = config.debug ? "http://logads.xwrun.com" : "https://logads.hainanmlwl.com";
     static version = "v1.0.0";
+    static hav_no_allAd = false;
     static static_url = {
         category: "/zcstatic/category.json", //玩法静态接口
         user_test: "/zcstatic/user_test.json", //测试用户

+ 7 - 1
assets/script/framework/sdkUtil.ts

@@ -1,7 +1,8 @@
-import { _decorator, SpriteFrame, sys } from "cc";
+import { _decorator, log, SpriteFrame, sys } from "cc";
 import { PlayerData } from "./playerData";
 import { StorageManager } from './storageManager';
 import { gameManager } from "../gameManager";
+import { config } from "../config";
 //管理广告、分享、SDK相关内容的组件
 export class SdkUtil {
     public static platform: string = 'cocos'; //平台
@@ -139,6 +140,11 @@ export class SdkUtil {
      */
 
     public static showVideoAd(_adUnitId: string, call_back) {
+        if(gameManager.havNoAllAd) {
+            call_back({isEnded:true})
+            return
+        }
+
         gameManager.showWaitView(100,"正在加载...");
         SdkUtil.videoAd = tt.createRewardedVideoAd({adUnitId: _adUnitId});
         SdkUtil.videoAd.onLoad(() => {

+ 3 - 0
assets/script/framework/statisticsManager.ts

@@ -57,6 +57,9 @@ export class StatisticsManager extends Component {
        */
 
     public static request_collect_rewardVideoData(data_item: statistics_collect_rewardVideo_data_item, call_back: any = null) {
+        if(gameManager.havNoAllAd) { 
+            return
+        }
         if (data_item == null) {
             return
         }

+ 1 - 1
assets/script/game.ts

@@ -1,4 +1,4 @@
-import { _decorator, Component, Node } from 'cc';
+import { _decorator, Component, log, Node } from 'cc';
 import { config } from './config';
 import { gameManager } from './gameManager';
 import { AudioManager } from './framework/audioManager';

+ 2 - 1
assets/script/gameManager.ts

@@ -1,4 +1,4 @@
-import { _decorator, assetManager, AudioClip, Component, instantiate, Label, Node, Prefab, resources, SpriteFrame, sys } from 'cc';
+import { _decorator, assetManager, AudioClip, Component, instantiate, Label, log, Node, Prefab, resources, SpriteFrame, sys } from 'cc';
 import { ads_config, server_han_zi_zhao_bu_tong_data, server_mei_nv_zhao_xi_jie_data, server_play_info, server_play_list_data, server_shuang_tu_zhao_bu_tong_data, server_sys_info, server_user_info, unlock_levels, unlock_levels_item } from './data/server_play_list_data';
 import { config } from './config';
 import { ClientEvent } from './framework/clientEvent';
@@ -31,6 +31,7 @@ export class gameManager extends Component {
     public static test_user_list:string[] = [];
     public static _instance: gameManager;
     public static isFinishLoad:boolean = false;
+    public static havNoAllAd:boolean = false;
 
     public static get instance () {
         if (this._instance) {

+ 1 - 1
assets/script/homepage/homepage.ts

@@ -53,7 +53,7 @@ export class homepage extends Component {
             gameManager.playBtnSound()
             gameManager.addTopView(config.PREFAB_PATH.setting,()=>{});
         },this)
-        this.btn_look_video.on(Node.EventType.TOUCH_START,()=>{
+        this.btn_look_video.on(Node.EventType.TOUCH_START,()=>{      
             SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Earn_coins_AdUnitId,(res)=>{
                 if(res.isEnded){
                     this.showLookVideoReward();

+ 2 - 1
assets/script/launch/view_launch.ts

@@ -1,4 +1,4 @@
-import { _decorator, Button, Component, Label, Node, ProgressBar, sys } from 'cc';
+import { _decorator, Button, Component, Label, log, Node, ProgressBar, sys } from 'cc';
 import { http } from '../http/http';
 import { config } from '../config';
 import { gameManager } from '../gameManager';
@@ -14,6 +14,7 @@ export class launch_view extends Component {
     start() {
         this.progress.getComponent(ProgressBar).progress = 0;
         // this.Interval_id=setInterval(this.setupLoading.bind(this),200);
+        gameManager.havNoAllAd = config.hav_no_allAd
         this.schedule(this.setupLoading,0.05)
     }
 

+ 1 - 1
assets/script/play_list/base_view.ts

@@ -53,7 +53,7 @@ export class base_view extends Component {
             gameManager.playBtnSound()
             self.close();
         },this);
-        this.btn_look_video.on(Node.EventType.TOUCH_START,()=>{            
+        this.btn_look_video.on(Node.EventType.TOUCH_START,()=>{     
             self.isPause  = true;
             SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Earn_coins_AdUnitId,(res)=>{
                 if(res.isEnded){

+ 9 - 1
assets/script/play_list/zhao_bu_tong/view_game_play_zhao_bu_tong.ts

@@ -1,4 +1,4 @@
-import { _decorator, Component, instantiate, Label, Node, Prefab, SpriteFrame, UITransform, Vec3 } from 'cc';
+import { _decorator, Component, instantiate, Label, log, Node, Prefab, SpriteFrame, UITransform, Vec3 } from 'cc';
 import { base_view } from '../base_view';
 import { tools } from '../../tools';
 import { gameManager } from '../../gameManager';
@@ -25,6 +25,12 @@ export class view_game_play_zhao_bu_tong extends base_view {
         this.categoryid = config.PLAY_TYPE.ZHAO_BU_TONG;
         let self = this;
         this.isShowWin = false;
+
+        let list = this.m_data.reward.split(",");
+        let start = parseInt(list[0]);
+        let end = parseInt(list[1]);
+        this.reward =  Util.getRandomInt(start,end);
+
         let call_back = ()=>{
             if(count>=this.m_data.img_list.length+1){
                 gameManager.loadPlayMusicByCategoryId(this.categoryid,()=>{
@@ -58,6 +64,7 @@ export class view_game_play_zhao_bu_tong extends base_view {
     }
     onGridItemClick(_diff_child_item:diff_child_item){
        if(_diff_child_item.isRight()){
+            gameManager.playRightSoundByCategoryId(this.categoryid);
             _diff_child_item.Finish()
             _diff_child_item.show()
             this.hideGuid()
@@ -78,6 +85,7 @@ export class view_game_play_zhao_bu_tong extends base_view {
             }
 
        }else{
+            gameManager.playErrSoundByCategoryId(this.categoryid);;
             _diff_child_item.showErrStatus()
             this.error_sub_time()
             this.showErrLab(_diff_child_item.node)