|
|
@@ -2,7 +2,7 @@
|
|
|
* @Author: mojunshou 1637302775@qq.com
|
|
|
* @Date: 2025-03-20 15:01:09
|
|
|
* @LastEditors: mojunshou 1637302775@qq.com
|
|
|
- * @LastEditTime: 2025-04-02 15:57:03
|
|
|
+ * @LastEditTime: 2025-04-02 17:55:03
|
|
|
* @Description: 消除游戏主场景
|
|
|
*/
|
|
|
import { _decorator, Color, EventTouch, instantiate, JsonAsset, Label, Node, Prefab, randomRangeInt, Sprite, Toggle, tween, UITransform, Vec2, Vec3, Widget } from "cc";
|
|
|
@@ -139,6 +139,9 @@ export class EliminateViewComp extends CCComp {
|
|
|
|
|
|
@property({ type: Button, displayName: "自动按钮" })
|
|
|
private autoBtn: Button = null!;
|
|
|
+ @property({ type: Button, displayName: "二倍速按钮" })
|
|
|
+ private addSpeedBtn: Button = null!;
|
|
|
+
|
|
|
|
|
|
|
|
|
//游戏配置行列
|
|
|
@@ -154,6 +157,8 @@ export class EliminateViewComp extends CCComp {
|
|
|
|
|
|
private totalNum: number = 0; //累计消除次数,断了就是又从0开始
|
|
|
|
|
|
+ private _isDoubleSpeed: boolean = false; //是否开启二倍速
|
|
|
+
|
|
|
//网格列表
|
|
|
// gridsNode: Node | null = null; //中间网格区域
|
|
|
// brickNode: Node | null = null; //底部三个item块区域
|
|
|
@@ -225,6 +230,7 @@ export class EliminateViewComp extends CCComp {
|
|
|
|
|
|
addEventList() {
|
|
|
oops.message.on(GameEvent.RestartGame, this.restartGame, this);
|
|
|
+ oops.message.on(GameEvent.DoubleSpeedOpenSuccess, this.doubleSpeedOpenSuccess, this);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1475,19 +1481,28 @@ export class EliminateViewComp extends CCComp {
|
|
|
this.node.destroy();
|
|
|
}
|
|
|
|
|
|
+ //设置按钮
|
|
|
private btn_setting() {
|
|
|
oops.gui.open(UIID.Setting);
|
|
|
}
|
|
|
|
|
|
+ //左边微信按钮
|
|
|
private btn_withdraw() {
|
|
|
oops.gui.open(UIID.WechatWithdraw);
|
|
|
}
|
|
|
|
|
|
+ //顶部红包按钮
|
|
|
private btn_award() {
|
|
|
oops.gui.open(UIID.RedPacketWithdraw);
|
|
|
}
|
|
|
|
|
|
+ //二倍速按钮
|
|
|
+ private btn_double() {
|
|
|
+ oops.gui.open(UIID.DoubleSpeed);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
+ //自动按钮
|
|
|
private btn_auto() {
|
|
|
//自动放置
|
|
|
this.autoState = !this.autoState;
|
|
|
@@ -1496,7 +1511,6 @@ export class EliminateViewComp extends CCComp {
|
|
|
this.gameState = GameState.PLAYING;
|
|
|
this.executeAutoPlace()
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1708,6 +1722,17 @@ export class EliminateViewComp extends CCComp {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ doubleSpeedOpenSuccess() {
|
|
|
+ this._isDoubleSpeed = true;
|
|
|
+ //3分钟后关闭
|
|
|
+ this.scheduleOnce(() => {
|
|
|
+ this._isDoubleSpeed = false;
|
|
|
+ //关闭会自动触发二倍速弹窗,这要带参数
|
|
|
+ // oops.gui.open(UIID.DoubleSpeed, { isAutoOpen: true });
|
|
|
+ }, 180);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//重新开始
|
|
|
private restartGame() {
|
|
|
if (this.gameState === GameState.READY) return;
|