From 49b9ff3f808716dce36524e96702e4e3d0b1f5fd Mon Sep 17 00:00:00 2001 From: "COMPUTER\\EDY" <249929363@qq.com> Date: Wed, 11 Feb 2026 11:29:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Script/Map.ts | 82 +++++++++++++++++++++++++-- assets/Script/Wall.ts | 40 +++++++++---- assets/Script/module/Tool/GameTool.ts | 4 +- 3 files changed, 107 insertions(+), 19 deletions(-) diff --git a/assets/Script/Map.ts b/assets/Script/Map.ts index fa0f410..147eb98 100644 --- a/assets/Script/Map.ts +++ b/assets/Script/Map.ts @@ -1336,6 +1336,7 @@ export default class MapConroler extends cc.Component { // 移动到下一组的位置 i += length; } + //顺时针跳跃 if (this.jump_state == true) { } @@ -1365,6 +1366,35 @@ export default class MapConroler extends cc.Component { // console.log("排序后的WALL_INFO数组:", this.jumpWallArray); } + jumpWallAction(startPos, endPos, wall) { + let startWall = this.jumpWallArray[startPos][0].getChildByName("revolving"); + let startLength = this.jumpWallArray[startPos][0].getChildByName("wall").getComponent("Wall").wall_Info.length; + let endWall = this.jumpWallArray[endPos][0].getChildByName("revolving"); + let endLength = this.jumpWallArray[endPos][0].getChildByName("wall").getComponent("Wall").wall_Info.length; + let startRotate = startWall.getChildByName("rotate" + startLength); + let endRotate = endWall.getChildByName("rotate" + endLength); + let startAngle = startRotate.angle; + let endAngle = endRotate.angle; + let startPosition = cc.v2(startRotate.parent.parent.x + startRotate.x, startRotate.parent.parent.y + startRotate.y); + let endPosition = cc.v2(endRotate.parent.parent.x + endRotate.x, endRotate.parent.parent.y + endRotate.y); + if (startAngle == -270 && endAngle == 0) startAngle = 90; + if (startAngle == 0 && endAngle == -270) startAngle = -360; + + let sp = new cc.Node(); + cc.tween(sp) + .call(() => { + wall[0].getChildByName("wall").getComponent("Wall").changeJumpWall(false); + }) + .delay(0.5) + .call(() => { + wall[1].getChildByName("wall").getComponent("Wall").changeJumpWall(true); + sp.destroy(); + }) + .start(); + + + } + //创建旋转门设置功能 createRevolvingWall() { // 第一步:将数组分为N个小数组,每个小数组以length不为0的元素开头 @@ -1855,15 +1885,54 @@ export default class MapConroler extends cc.Component { } // console.log("跳跃一次"); //有跳跃门,根据跳跃门数组,改变跳跃门状态,受跳跃方向影响 + let wallStart = this.jumpWallArray[0]; + let wallArray = []; + for (let i = 0; i < this.jumpWallArray.length; i++) { let wall = this.jumpWallArray[i]; - if (wall[0].getChildByName("wall").getComponent("Wall").special == 2) { - wall[0].getChildByName("wall").getComponent("Wall").special = 3; - } - else { - wall[0].getChildByName("wall").getComponent("Wall").special = 2; + for (let j = 0; j < wall.length; j++) { + wallArray.push(this.jumpWallArray[i][j]); + if (this.jumpWallArray[i][j].getChildByName("wall").getComponent("Wall").jumpNode) { + for (let k = 0; k < wall.length; k++) { + this.jumpWallArray[i][j].getChildByName("wall").getComponent("Wall").changeJumpWall(false); + } + } } } + + for (let i = 0; i < wallArray.length; i++) { + if (wallArray[i].getChildByName("wall").getComponent("Wall").jumpNode) { + wallArray[i].getChildByName("wall").getComponent("Wall").jumpNode = null; + if (i == wallArray.length - 1) { + wallArray[0].getChildByName("wall").getComponent("Wall").changeJumpWall(true); + break; + } + else { + wallArray[i + 1].getChildByName("wall").getComponent("Wall").changeJumpWall(true); + i += 1; + } + + } + + } + + + // for (let j = 0; j < wallArray.length; j++) { + // if (wallArray[j] < (this.jumpWallArray.length - 1)) { + // let wall2 = this.jumpWallArray[wallArray[j] + 1]; + // for (let k = 0; k < wall2.length; k++) { + // // wall2[k].getChildByName("wall").getComponent("Wall").special = special; + // } + // this.jumpWallAction(wallArray[j], wallArray[j] + 1, wall2); + // } + // else { + // let wall3 = wallStart; + // for (let k = 0; k < wall3.length; k++) { + // // wall3[k].getChildByName("wall").getComponent("Wall").special = special; + // } + // this.jumpWallAction(wallArray[j], 0, wall3); + // } + // } } changeRevolvingWall() { @@ -2963,6 +3032,7 @@ export default class MapConroler extends cc.Component { this.changeLockWall(); this.changeRevolvingWall(); this.changeLongAndShortWall(); + this.changeJumpWall(); if (cc.fx.GameConfig.GM_INFO.reviewDoor < 2) cc.fx.GameConfig.GM_INFO.reviewDoor += 1; } @@ -2970,6 +3040,7 @@ export default class MapConroler extends cc.Component { this.changeLockWall(); this.changeRevolvingWall(); this.changeLongAndShortWall(); + this.changeJumpWall(); if (cc.fx.GameConfig.GM_INFO.reviewRevolving < 2) cc.fx.GameConfig.GM_INFO.reviewRevolving += 1; } @@ -2977,6 +3048,7 @@ export default class MapConroler extends cc.Component { this.changeLockWall(); this.changeRevolvingWall(); this.changeLongAndShortWall(); + this.changeJumpWall(); if (cc.fx.GameConfig.GM_INFO.reviewLongAndShort < 2) cc.fx.GameConfig.GM_INFO.reviewLongAndShort += 1; } diff --git a/assets/Script/Wall.ts b/assets/Script/Wall.ts index deea065..ffa29dd 100644 --- a/assets/Script/Wall.ts +++ b/assets/Script/Wall.ts @@ -189,21 +189,15 @@ export default class Wall extends cc.Component { //旋转门 let name2 = "rotate" + this.wall_Info.length; this.revolvingNode = this.node.parent.getChildByName("revolving").getChildByName(name2); - this.jumpNode = this.node.parent.getChildByName("jump"); - // if (this.jumpNode) { - // this.jumpNode.active = true; - // console.log("跳跃门 一个"); - // } - //跳跃门 - this.jumpNode = this.node.parent.getChildByName("jump"); if (this.wall_Info.jump != undefined) { - this.jumpNode.active = true; - if (this.wall_Info.length == 0 && (this.node.parent.name == "right" || this.node.parent.name == "left")) { - debugger; - this.node.parent.zIndex = 999; - } + this.jumpInit(); } + else { + this.jumpNode = null; + } + //跳跃门 + if (this.wall_Info.colorArray) { this.colorArray = this.wall_Info.colorArray.split('').map(char => parseInt(char) + 1); @@ -565,6 +559,28 @@ export default class Wall extends cc.Component { } } + //跳跃门跳跃 + changeJumpWall(type) { + if (type == true) { + this.jumpInit(); + } + else { + this.jumpNode.active = false; + } + } + + //跳跃门初始化 + jumpInit() { + this.jumpNode = this.node.parent.getChildByName("jump"); + this.jumpNode.active = true; + if (this.wall_Info.length == 0 && (this.node.parent.name == "right" || this.node.parent.name == "left")) { + this.node.parent.zIndex = 999; + } + + } + + + //变色门变色总方法 changeColorWall() { // console.log("通过此门,调用次门数组", this.colorArray); diff --git a/assets/Script/module/Tool/GameTool.ts b/assets/Script/module/Tool/GameTool.ts index fdb3b73..bcced26 100644 --- a/assets/Script/module/Tool/GameTool.ts +++ b/assets/Script/module/Tool/GameTool.ts @@ -443,8 +443,8 @@ var GameTool = { //关卡上限 maxLevel() { let jg = false; - if (cc.fx.GameConfig.GM_INFO.level > 1149) { - cc.fx.GameConfig.GM_INFO.level = 1150; + if (cc.fx.GameConfig.GM_INFO.level > 1199) { + cc.fx.GameConfig.GM_INFO.level = 1200; jg = true; } return jg;