|
|
@@ -2,7 +2,7 @@
|
|
|
* @Author: mojunshou 1637302775@qq.com
|
|
|
* @Date: 2025-03-20 15:01:09
|
|
|
* @LastEditors: mojunshou 1637302775@qq.com
|
|
|
- * @LastEditTime: 2025-04-19 16:58:13
|
|
|
+ * @LastEditTime: 2025-04-19 17:32:25
|
|
|
* @Description: 消除游戏主场景
|
|
|
*/
|
|
|
import { _decorator, Button, Color, EventTouch, instantiate, JsonAsset, Label, Node, Prefab, randomRangeInt, Sprite, tween, UITransform, Vec2, Vec3, Widget } from "cc";
|
|
|
@@ -1432,7 +1432,21 @@ export class EliminateViewComp extends CCComp {
|
|
|
this.scheduleOnce(() => {
|
|
|
// 递归调用,检查并处理连锁消除
|
|
|
this.gridEliminate().then(() => {
|
|
|
- // 连锁消除结束,不做额外处理
|
|
|
+ if (this.eliminateInterval.length == 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const minNum = this.eliminateInterval[0]
|
|
|
+ const maxNum = this.eliminateInterval[1]
|
|
|
+ const randomNum = randomRangeInt(minNum, maxNum + 1);
|
|
|
+ //这个数可以被总消除次数整除那就可以弹广告
|
|
|
+ if (this.eliminateTotal % randomNum === 0) {
|
|
|
+ // oops.gui.open(UIID.DoubleSpeed);
|
|
|
+ //如果有自动就暂停自动
|
|
|
+ this.gameState = GameState.PAUSED;
|
|
|
+ console.log("弹出翻倍广告");
|
|
|
+ ServerHandler.inst.getDoubleSurprise();
|
|
|
+ //弹出广告
|
|
|
+ }
|
|
|
});
|
|
|
}, 0.2);
|
|
|
}, 0.2)
|
|
|
@@ -1803,23 +1817,6 @@ export class EliminateViewComp extends CCComp {
|
|
|
}
|
|
|
|
|
|
//是否展示翻倍广告
|
|
|
- //从上边的随机数组区里边的两个数间取一个整数
|
|
|
- if (this.eliminateInterval.length == 0) {
|
|
|
- return;
|
|
|
- }
|
|
|
- const minNum = this.eliminateInterval[0]
|
|
|
- const maxNum = this.eliminateInterval[1]
|
|
|
- const randomNum = randomRangeInt(minNum, maxNum + 1);
|
|
|
- //这个数可以被总消除次数整除那就可以弹广告
|
|
|
- if (this.eliminateTotal % randomNum === 0) {
|
|
|
- // oops.gui.open(UIID.DoubleSpeed);
|
|
|
- //如果有自动就暂停自动
|
|
|
- this.gameState = GameState.PAUSED;
|
|
|
- console.log("弹出翻倍广告");
|
|
|
- ServerHandler.inst.getDoubleSurprise();
|
|
|
- //弹出广告
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
}
|
|
|
|