更新状态
This commit is contained in:
parent
efa33f5936
commit
49b9ff3f80
|
|
@ -1336,6 +1336,7 @@ export default class MapConroler extends cc.Component {
|
||||||
// 移动到下一组的位置
|
// 移动到下一组的位置
|
||||||
i += length;
|
i += length;
|
||||||
}
|
}
|
||||||
|
|
||||||
//顺时针跳跃
|
//顺时针跳跃
|
||||||
if (this.jump_state == true) {
|
if (this.jump_state == true) {
|
||||||
}
|
}
|
||||||
|
|
@ -1365,6 +1366,35 @@ export default class MapConroler extends cc.Component {
|
||||||
// console.log("排序后的WALL_INFO数组:", this.jumpWallArray);
|
// 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() {
|
createRevolvingWall() {
|
||||||
// 第一步:将数组分为N个小数组,每个小数组以length不为0的元素开头
|
// 第一步:将数组分为N个小数组,每个小数组以length不为0的元素开头
|
||||||
|
|
@ -1855,15 +1885,54 @@ export default class MapConroler extends cc.Component {
|
||||||
}
|
}
|
||||||
// console.log("跳跃一次");
|
// console.log("跳跃一次");
|
||||||
//有跳跃门,根据跳跃门数组,改变跳跃门状态,受跳跃方向影响
|
//有跳跃门,根据跳跃门数组,改变跳跃门状态,受跳跃方向影响
|
||||||
|
let wallStart = this.jumpWallArray[0];
|
||||||
|
let wallArray = [];
|
||||||
|
|
||||||
for (let i = 0; i < this.jumpWallArray.length; i++) {
|
for (let i = 0; i < this.jumpWallArray.length; i++) {
|
||||||
let wall = this.jumpWallArray[i];
|
let wall = this.jumpWallArray[i];
|
||||||
if (wall[0].getChildByName("wall").getComponent("Wall").special == 2) {
|
for (let j = 0; j < wall.length; j++) {
|
||||||
wall[0].getChildByName("wall").getComponent("Wall").special = 3;
|
wallArray.push(this.jumpWallArray[i][j]);
|
||||||
}
|
if (this.jumpWallArray[i][j].getChildByName("wall").getComponent("Wall").jumpNode) {
|
||||||
else {
|
for (let k = 0; k < wall.length; k++) {
|
||||||
wall[0].getChildByName("wall").getComponent("Wall").special = 2;
|
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() {
|
changeRevolvingWall() {
|
||||||
|
|
@ -2963,6 +3032,7 @@ export default class MapConroler extends cc.Component {
|
||||||
this.changeLockWall();
|
this.changeLockWall();
|
||||||
this.changeRevolvingWall();
|
this.changeRevolvingWall();
|
||||||
this.changeLongAndShortWall();
|
this.changeLongAndShortWall();
|
||||||
|
this.changeJumpWall();
|
||||||
if (cc.fx.GameConfig.GM_INFO.reviewDoor < 2)
|
if (cc.fx.GameConfig.GM_INFO.reviewDoor < 2)
|
||||||
cc.fx.GameConfig.GM_INFO.reviewDoor += 1;
|
cc.fx.GameConfig.GM_INFO.reviewDoor += 1;
|
||||||
}
|
}
|
||||||
|
|
@ -2970,6 +3040,7 @@ export default class MapConroler extends cc.Component {
|
||||||
this.changeLockWall();
|
this.changeLockWall();
|
||||||
this.changeRevolvingWall();
|
this.changeRevolvingWall();
|
||||||
this.changeLongAndShortWall();
|
this.changeLongAndShortWall();
|
||||||
|
this.changeJumpWall();
|
||||||
if (cc.fx.GameConfig.GM_INFO.reviewRevolving < 2)
|
if (cc.fx.GameConfig.GM_INFO.reviewRevolving < 2)
|
||||||
cc.fx.GameConfig.GM_INFO.reviewRevolving += 1;
|
cc.fx.GameConfig.GM_INFO.reviewRevolving += 1;
|
||||||
}
|
}
|
||||||
|
|
@ -2977,6 +3048,7 @@ export default class MapConroler extends cc.Component {
|
||||||
this.changeLockWall();
|
this.changeLockWall();
|
||||||
this.changeRevolvingWall();
|
this.changeRevolvingWall();
|
||||||
this.changeLongAndShortWall();
|
this.changeLongAndShortWall();
|
||||||
|
this.changeJumpWall();
|
||||||
if (cc.fx.GameConfig.GM_INFO.reviewLongAndShort < 2)
|
if (cc.fx.GameConfig.GM_INFO.reviewLongAndShort < 2)
|
||||||
cc.fx.GameConfig.GM_INFO.reviewLongAndShort += 1;
|
cc.fx.GameConfig.GM_INFO.reviewLongAndShort += 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -189,21 +189,15 @@ export default class Wall extends cc.Component {
|
||||||
//旋转门
|
//旋转门
|
||||||
let name2 = "rotate" + this.wall_Info.length;
|
let name2 = "rotate" + this.wall_Info.length;
|
||||||
this.revolvingNode = this.node.parent.getChildByName("revolving").getChildByName(name2);
|
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) {
|
if (this.wall_Info.jump != undefined) {
|
||||||
this.jumpNode.active = true;
|
this.jumpInit();
|
||||||
if (this.wall_Info.length == 0 && (this.node.parent.name == "right" || this.node.parent.name == "left")) {
|
|
||||||
debugger;
|
|
||||||
this.node.parent.zIndex = 999;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
this.jumpNode = null;
|
||||||
|
}
|
||||||
|
//跳跃门
|
||||||
|
|
||||||
|
|
||||||
if (this.wall_Info.colorArray) {
|
if (this.wall_Info.colorArray) {
|
||||||
this.colorArray = this.wall_Info.colorArray.split('').map(char => parseInt(char) + 1);
|
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() {
|
changeColorWall() {
|
||||||
// console.log("通过此门,调用次门数组", this.colorArray);
|
// console.log("通过此门,调用次门数组", this.colorArray);
|
||||||
|
|
|
||||||
|
|
@ -443,8 +443,8 @@ var GameTool = {
|
||||||
//关卡上限
|
//关卡上限
|
||||||
maxLevel() {
|
maxLevel() {
|
||||||
let jg = false;
|
let jg = false;
|
||||||
if (cc.fx.GameConfig.GM_INFO.level > 1149) {
|
if (cc.fx.GameConfig.GM_INFO.level > 1199) {
|
||||||
cc.fx.GameConfig.GM_INFO.level = 1150;
|
cc.fx.GameConfig.GM_INFO.level = 1200;
|
||||||
jg = true;
|
jg = true;
|
||||||
}
|
}
|
||||||
return jg;
|
return jg;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user