更新
This commit is contained in:
parent
7fb40063b4
commit
60275b790a
|
|
@ -722,12 +722,11 @@ export default class Block extends cc.Component {
|
||||||
this.isTouch = false;
|
this.isTouch = false;
|
||||||
MapConroler._instance.hammerMask.active = false;
|
MapConroler._instance.hammerMask.active = false;
|
||||||
MapConroler._instance.node.parent.getChildByName("Bottom").getChildByName("destroyBtn").getComponent("btnControl").setTouch(true);
|
MapConroler._instance.node.parent.getChildByName("Bottom").getChildByName("destroyBtn").getComponent("btnControl").setTouch(true);
|
||||||
console.log("222使用特殊锤子", MapConroler._instance.hammerSpecial);
|
|
||||||
if (MapConroler._instance.hammerSpecial == true) {
|
if (MapConroler._instance.hammerSpecial == true) {
|
||||||
MapConroler._instance.hammerSpecial = false;
|
MapConroler._instance.hammerSpecial = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.log("222使用普通锤子");
|
|
||||||
MapConroler._instance.costHammer();
|
MapConroler._instance.costHammer();
|
||||||
}
|
}
|
||||||
MapConroler._instance.usePause();
|
MapConroler._instance.usePause();
|
||||||
|
|
@ -962,9 +961,9 @@ export default class Block extends cc.Component {
|
||||||
}
|
}
|
||||||
MapConroler._instance.nextLevel(0);
|
MapConroler._instance.nextLevel(0);
|
||||||
let colorTemp = this.color;
|
let colorTemp = this.color;
|
||||||
MapConroler._instance.checkColor(colorTemp, true);
|
|
||||||
this.node.active = false;
|
this.node.active = false;
|
||||||
this.node.removeFromParent();
|
this.node.removeFromParent();
|
||||||
|
MapConroler._instance.checkColor(colorTemp, true);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (MapConroler._instance.blockNum != 0 && (MapConroler._instance.openWall.length > 0 ||
|
if (MapConroler._instance.blockNum != 0 && (MapConroler._instance.openWall.length > 0 ||
|
||||||
MapConroler._instance.revolving_state != 0)
|
MapConroler._instance.revolving_state != 0)
|
||||||
|
|
@ -1118,10 +1117,11 @@ export default class Block extends cc.Component {
|
||||||
cc.fx.AudioManager._instance.playEffect("lockBlock2", null);
|
cc.fx.AudioManager._instance.playEffect("lockBlock2", null);
|
||||||
}
|
}
|
||||||
let colorTemp = this.color;
|
let colorTemp = this.color;
|
||||||
MapConroler._instance.checkColor(colorTemp, true);
|
|
||||||
MapConroler._instance.nextLevel(0);
|
MapConroler._instance.nextLevel(0);
|
||||||
this.node.active = false;
|
this.node.active = false;
|
||||||
this.node.removeFromParent();
|
this.node.removeFromParent();
|
||||||
|
MapConroler._instance.checkColor(colorTemp, true);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (MapConroler._instance.blockNum != 0 && (MapConroler._instance.openWall.length > 0 ||
|
if (MapConroler._instance.blockNum != 0 && (MapConroler._instance.openWall.length > 0 ||
|
||||||
MapConroler._instance.revolving_state != 0)
|
MapConroler._instance.revolving_state != 0)
|
||||||
|
|
|
||||||
|
|
@ -1500,6 +1500,7 @@ export default class MapConroler extends cc.Component {
|
||||||
|
|
||||||
if (upWalls.length != 0) {
|
if (upWalls.length != 0) {
|
||||||
let result = this.detectingBlock("up", node.getComponent("Block").posX, node.getComponent("Block").posY, allBlocks);
|
let result = this.detectingBlock("up", node.getComponent("Block").posX, node.getComponent("Block").posY, allBlocks);
|
||||||
|
|
||||||
if (result == true) result = this.passWall(result, upWalls, node);
|
if (result == true) result = this.passWall(result, upWalls, node);
|
||||||
// console.log("碰到上边缘结果:", result);
|
// console.log("碰到上边缘结果:", result);
|
||||||
if (result) {
|
if (result) {
|
||||||
|
|
@ -1595,7 +1596,6 @@ export default class MapConroler extends cc.Component {
|
||||||
}
|
}
|
||||||
// const date8 = new Date().getTime();
|
// const date8 = new Date().getTime();
|
||||||
// console.log("检测颜色是否能够通过门",date8);
|
// console.log("检测颜色是否能够通过门",date8);
|
||||||
|
|
||||||
if (jg == true) {
|
if (jg == true) {
|
||||||
this.checkColor(node.getComponent("Block").color, false);
|
this.checkColor(node.getComponent("Block").color, false);
|
||||||
if (wallArray[0].getComponent("Wall").colorArray.length > 0) {
|
if (wallArray[0].getComponent("Wall").colorArray.length > 0) {
|
||||||
|
|
@ -1607,23 +1607,30 @@ export default class MapConroler extends cc.Component {
|
||||||
|
|
||||||
checkColor(colorTemp, type) {
|
checkColor(colorTemp, type) {
|
||||||
let colorArray = [];
|
let colorArray = [];
|
||||||
|
let number = 1;
|
||||||
|
if (type) number = 0;
|
||||||
for (let i = 0; i < this.colorDoors.length; i++) {
|
for (let i = 0; i < this.colorDoors.length; i++) {
|
||||||
if (this.colorDoors[i].colorArray.length > 0) {
|
// if (this.colorDoors[i].colorArray.length > 0) {
|
||||||
colorArray.push(this.colorDoors[i]);
|
colorArray.push(this.colorDoors[i]);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
let colorOver = true;
|
let colorOver = true;
|
||||||
let count = 0;
|
let count = 0;
|
||||||
for (let i = 0; i < this.blocks.length; i++) {
|
for (let i = 0; i < this.blocks.length; i++) {
|
||||||
|
if (this.blocks[i]) {
|
||||||
|
if (this.blocks[i].active) {
|
||||||
let color = this.blocks[i].getComponent("Block").color;
|
let color = this.blocks[i].getComponent("Block").color;
|
||||||
if (color == colorTemp) {
|
if (color == colorTemp) {
|
||||||
count += 1;
|
count += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (count > 1) {
|
if (count > number) {
|
||||||
colorOver = false;
|
colorOver = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//是变色门关卡,并且消除的块是当前颜色最后一个,对变色门中该颜色做消除处理 3 1 2 4 5 6
|
//是变色门关卡,并且消除的块是当前颜色最后一个,对变色门中该颜色做消除处理 3 1 2 4 5 6
|
||||||
if (colorOver == true && colorArray.length > 0) {
|
if (colorOver == true && colorArray.length > 0) {
|
||||||
for (let j = 0; j < colorArray.length; j++) {
|
for (let j = 0; j < colorArray.length; j++) {
|
||||||
|
|
@ -2123,7 +2130,7 @@ export default class MapConroler extends cc.Component {
|
||||||
|
|
||||||
//执行复活函数
|
//执行复活函数
|
||||||
runRewive(data) {
|
runRewive(data) {
|
||||||
console.log("复活回调函数内", data);
|
// console.log("复活回调函数内", data);
|
||||||
this.isreview = true;
|
this.isreview = true;
|
||||||
cc.fx.GameTool.changeCoin(data.coin);
|
cc.fx.GameTool.changeCoin(data.coin);
|
||||||
const dataTemp = {
|
const dataTemp = {
|
||||||
|
|
@ -2370,7 +2377,7 @@ export default class MapConroler extends cc.Component {
|
||||||
this.node.parent.parent.getChildByName("Lose").getChildByName("share").active = false;
|
this.node.parent.parent.getChildByName("Lose").getChildByName("share").active = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.log("有分享按钮");
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.node.parent.parent.getChildByName("Lose").getChildByName("share").active = true;
|
this.node.parent.parent.getChildByName("Lose").getChildByName("share").active = true;
|
||||||
}, 350);
|
}, 350);
|
||||||
|
|
@ -2531,7 +2538,7 @@ export default class MapConroler extends cc.Component {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var pause = this.iceTrue();
|
var pause = this.iceTrue();
|
||||||
console.log("冰冻状态:", pause);
|
// console.log("冰冻状态:", pause);
|
||||||
if (pause == true) {
|
if (pause == true) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -2678,7 +2685,7 @@ export default class MapConroler extends cc.Component {
|
||||||
{ type: "freeze", count: 3 },
|
{ type: "freeze", count: 3 },
|
||||||
]
|
]
|
||||||
MapConroler._instance.SceneManager.openRewardWindow(data, () => {
|
MapConroler._instance.SceneManager.openRewardWindow(data, () => {
|
||||||
console.log("_________恢复游戏");
|
|
||||||
var pause2 = this.iceTrue();
|
var pause2 = this.iceTrue();
|
||||||
if (pause2 == false) {
|
if (pause2 == false) {
|
||||||
this.pause = false;
|
this.pause = false;
|
||||||
|
|
@ -2704,7 +2711,7 @@ export default class MapConroler extends cc.Component {
|
||||||
{ type: "magic", count: 3 },
|
{ type: "magic", count: 3 },
|
||||||
]
|
]
|
||||||
MapConroler._instance.SceneManager.openRewardWindow(data, () => {
|
MapConroler._instance.SceneManager.openRewardWindow(data, () => {
|
||||||
console.log("_________恢复游戏");
|
|
||||||
var pause2 = this.iceTrue();
|
var pause2 = this.iceTrue();
|
||||||
if (pause2 == false) {
|
if (pause2 == false) {
|
||||||
this.pause = false;
|
this.pause = false;
|
||||||
|
|
@ -2729,7 +2736,7 @@ export default class MapConroler extends cc.Component {
|
||||||
{ type: "hammer", count: 1 },
|
{ type: "hammer", count: 1 },
|
||||||
]
|
]
|
||||||
MapConroler._instance.SceneManager.openRewardWindow(data, () => {
|
MapConroler._instance.SceneManager.openRewardWindow(data, () => {
|
||||||
console.log("_________恢复游戏");
|
|
||||||
var pause2 = this.iceTrue();
|
var pause2 = this.iceTrue();
|
||||||
if (pause2 == false) {
|
if (pause2 == false) {
|
||||||
this.pause = false;
|
this.pause = false;
|
||||||
|
|
@ -2813,7 +2820,7 @@ export default class MapConroler extends cc.Component {
|
||||||
cc.fx.GameConfig.GM_INFO.hammerAmount = 0;
|
cc.fx.GameConfig.GM_INFO.hammerAmount = 0;
|
||||||
this.setPropNum();
|
this.setPropNum();
|
||||||
let propInfo = cc.fx.StorageMessage.getStorage("prop");
|
let propInfo = cc.fx.StorageMessage.getStorage("prop");
|
||||||
console.log("锤子道具信息:", propInfo);
|
|
||||||
propInfo.hammerAmount = cc.fx.GameConfig.GM_INFO.hammerAmount;
|
propInfo.hammerAmount = cc.fx.GameConfig.GM_INFO.hammerAmount;
|
||||||
propInfo.timestamp = timestamp;
|
propInfo.timestamp = timestamp;
|
||||||
cc.fx.StorageMessage.setStorage("prop", propInfo);
|
cc.fx.StorageMessage.setStorage("prop", propInfo);
|
||||||
|
|
@ -2824,7 +2831,6 @@ export default class MapConroler extends cc.Component {
|
||||||
id: "2002",
|
id: "2002",
|
||||||
num: -1
|
num: -1
|
||||||
}
|
}
|
||||||
console.log("____________消耗锤子cost");
|
|
||||||
cc.fx.GameTool.shushu_Track("resource_cost", data);
|
cc.fx.GameTool.shushu_Track("resource_cost", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3301,7 +3307,6 @@ export default class MapConroler extends cc.Component {
|
||||||
nomalArray.push(this.blocks[i].getComponent("Block").block_Info.node);
|
nomalArray.push(this.blocks[i].getComponent("Block").block_Info.node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// else nomalArray.push(this.blocks[i]);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!this.blocks[i].getComponent("Block").isEliminatedByHammer) {
|
if (!this.blocks[i].getComponent("Block").isEliminatedByHammer) {
|
||||||
|
|
@ -3612,17 +3617,21 @@ export default class MapConroler extends cc.Component {
|
||||||
predict_End(colorTemp: number) {
|
predict_End(colorTemp: number) {
|
||||||
//return true;
|
//return true;
|
||||||
// console.log("提前判断游戏结束");
|
// console.log("提前判断游戏结束");
|
||||||
if (this.gameOver || this.gameWin || this.changeColor) {
|
if (this.gameOver || this.gameWin) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
//有变色门,且无开关门
|
||||||
|
if (this.changeColor == true && this.openWall.length == 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
let result = false;
|
|
||||||
if (this.blocks.length == 0) {
|
if (this.blocks.length == 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
let result = false;
|
||||||
let colorOver = true;
|
let colorOver = true;
|
||||||
|
let openResult = true;
|
||||||
for (let i = 0; i < this.blocks.length; i++) {
|
for (let i = 0; i < this.blocks.length; i++) {
|
||||||
let color = this.blocks[i].getComponent("Block").color;
|
let color = this.blocks[i].getComponent("Block").color;
|
||||||
if (color == colorTemp) colorOver = false;
|
|
||||||
//确保方块是可移动状态下再做判断
|
//确保方块是可移动状态下再做判断
|
||||||
if (this.blockCanMove(this.blocks[i])) {
|
if (this.blockCanMove(this.blocks[i])) {
|
||||||
for (let j = 0; j < this.wall_Pass.length; j++) {
|
for (let j = 0; j < this.wall_Pass.length; j++) {
|
||||||
|
|
@ -3651,6 +3660,9 @@ export default class MapConroler extends cc.Component {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (this.blockCanPass(this.blocks[i], this.wall_Pass[j])) {
|
||||||
|
openResult = false;
|
||||||
|
}
|
||||||
// console.log("开关门并且关着,________不可通行");
|
// console.log("开关门并且关着,________不可通行");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -3671,9 +3683,9 @@ export default class MapConroler extends cc.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//是变色门关卡,并且消除的块是当前颜色最后一个,对变色门中该颜色做消除处理
|
//是变色门关卡,并且消除的块是当前颜色最后一个,对变色门中该颜色做消除处理
|
||||||
// if (colorOver == true && this.changeColor == true) {
|
if (openResult == true && this.changeColor == true) {
|
||||||
|
result = true;
|
||||||
// }
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -455,7 +455,7 @@ export default class SceneManager extends cc.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
openRewardWindow(data, callBack) {
|
openRewardWindow(data, callBack) {
|
||||||
console.log("_____________________打开奖励弹窗", data);
|
// console.log("_____________________打开奖励弹窗", data);
|
||||||
if (!SceneManager.cachedRewardPrefab) {
|
if (!SceneManager.cachedRewardPrefab) {
|
||||||
cc.error('Reward prefab is not loaded yet.');
|
cc.error('Reward prefab is not loaded yet.');
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -227,11 +227,6 @@ export default class Wall extends cc.Component {
|
||||||
double = 3;
|
double = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (this.colorArray.length > 1) {
|
|
||||||
// let firstItem = this.colorArray.shift(); // 移除第一项
|
|
||||||
// this.colorArray.push(firstItem); // 将第一项添加到数组末尾
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (this.wall_SpriteFrames) {
|
if (this.wall_SpriteFrames) {
|
||||||
let name = this.color + "color" + (length + double);
|
let name = this.color + "color" + (length + double);
|
||||||
var spriteFrame = this.wall_SpriteFrames._spriteFrames[name];
|
var spriteFrame = this.wall_SpriteFrames._spriteFrames[name];
|
||||||
|
|
@ -329,24 +324,6 @@ export default class Wall extends cc.Component {
|
||||||
this.maskNode.active = true;
|
this.maskNode.active = true;
|
||||||
this.setMask();
|
this.setMask();
|
||||||
}
|
}
|
||||||
|
|
||||||
// let color = cc.instantiate(MapConroler._instance.Block_Prop[4]);
|
|
||||||
// color.parent = this.node.parent;
|
|
||||||
// if (this.wall_Info.length == 0) {
|
|
||||||
// color.opacity = 0;
|
|
||||||
// }
|
|
||||||
// color.scaleX = color.scaleY = 0.65;
|
|
||||||
// if (this.direction == "up") {
|
|
||||||
// color.setPosition((this.wall_Info.length - 1) * 60 - 10, 38);
|
|
||||||
// if (this.wall_Info.length == 1) color.x += 5;
|
|
||||||
// }
|
|
||||||
// else if (this.direction == "down") {
|
|
||||||
// color.setPosition((this.wall_Info.length - 1) * 60 - 10, -38);
|
|
||||||
// if (this.wall_Info.length == 1) color.x += 5;
|
|
||||||
// }
|
|
||||||
// if (this.direction == "right") {
|
|
||||||
// color.setPosition(30, (this.wall_Info.length - 1) * 60);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -476,6 +453,7 @@ export default class Wall extends cc.Component {
|
||||||
if (direction == "left" || direction == "right") {
|
if (direction == "left" || direction == "right") {
|
||||||
double = 3;
|
double = 3;
|
||||||
}
|
}
|
||||||
|
if (this.colorArray.length > 1) {
|
||||||
let color = this.colorArray[1];
|
let color = this.colorArray[1];
|
||||||
if (this.wall_SpriteFrames) {
|
if (this.wall_SpriteFrames) {
|
||||||
let name = color + "color" + (this.wall_Info.length + double);
|
let name = color + "color" + (this.wall_Info.length + double);
|
||||||
|
|
@ -483,6 +461,10 @@ export default class Wall extends cc.Component {
|
||||||
this.maskNode.getChildByName("color_icon").getComponent(cc.Sprite).spriteFrame = spriteFrame;
|
this.maskNode.getChildByName("color_icon").getComponent(cc.Sprite).spriteFrame = spriteFrame;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
this.maskNode.getChildByName("color_icon").opacity = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.node.opacity = 250;
|
this.node.opacity = 250;
|
||||||
}
|
}
|
||||||
|
|
@ -531,9 +513,12 @@ export default class Wall extends cc.Component {
|
||||||
if (this.colorArray.length > 1 && this.color == this.colorArray[0]) {
|
if (this.colorArray.length > 1 && this.color == this.colorArray[0]) {
|
||||||
let firstItem = this.colorArray.shift(); // 移除第一项
|
let firstItem = this.colorArray.shift(); // 移除第一项
|
||||||
this.colorArray.push(firstItem); // 将第一项添加到数组末尾
|
this.colorArray.push(firstItem); // 将第一项添加到数组末尾
|
||||||
}
|
|
||||||
this.updateColor();
|
this.updateColor();
|
||||||
}
|
}
|
||||||
|
else if (this.colorArray.length == 1 && this.color != this.colorArray[0]) {
|
||||||
|
this.updateColor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
updateColor() {
|
updateColor() {
|
||||||
this.color = this.colorArray[0];
|
this.color = this.colorArray[0];
|
||||||
|
|
@ -575,7 +560,7 @@ export default class Wall extends cc.Component {
|
||||||
|
|
||||||
//变色门删除颜色
|
//变色门删除颜色
|
||||||
removeColor(color, type) {
|
removeColor(color, type) {
|
||||||
if (this.colorArray.length > 2) {
|
if (this.colorArray.length > 1) {
|
||||||
let index = this.colorArray.indexOf(color);
|
let index = this.colorArray.indexOf(color);
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
this.colorArray.splice(index, 1);
|
this.colorArray.splice(index, 1);
|
||||||
|
|
@ -591,6 +576,7 @@ export default class Wall extends cc.Component {
|
||||||
if (direction == "left" || direction == "right") {
|
if (direction == "left" || direction == "right") {
|
||||||
double = 3;
|
double = 3;
|
||||||
}
|
}
|
||||||
|
if (this.colorArray.length > 1) {
|
||||||
let color = this.colorArray[1];
|
let color = this.colorArray[1];
|
||||||
if (this.wall_SpriteFrames) {
|
if (this.wall_SpriteFrames) {
|
||||||
let name = color + "color" + (this.wall_Info.length + double);
|
let name = color + "color" + (this.wall_Info.length + double);
|
||||||
|
|
@ -601,6 +587,10 @@ export default class Wall extends cc.Component {
|
||||||
.to(0.2, { fillRange: 1 })
|
.to(0.2, { fillRange: 1 })
|
||||||
.start();
|
.start();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.maskNode.getChildByName("color_icon").opacity = 0;
|
||||||
|
}
|
||||||
// 设置遮罩节点大小和位置
|
// 设置遮罩节点大小和位置
|
||||||
if (this.node.parent.name == "down") {
|
if (this.node.parent.name == "down") {
|
||||||
if (this.wall_Info.length == 3) {
|
if (this.wall_Info.length == 3) {
|
||||||
|
|
|
||||||
|
|
@ -1168,6 +1168,7 @@ var GameTool = {
|
||||||
// MiniGameSdk.API.showToast("准备上报完成游戏");
|
// MiniGameSdk.API.showToast("准备上报完成游戏");
|
||||||
}
|
}
|
||||||
if (name == "finish_stage") {
|
if (name == "finish_stage") {
|
||||||
|
if (data.result)
|
||||||
MiniGameSdk.API.yinli_FinishiStage();
|
MiniGameSdk.API.yinli_FinishiStage();
|
||||||
}
|
}
|
||||||
// MiniGameSdk.API.shushu_Track(name,eventData);
|
// MiniGameSdk.API.shushu_Track(name,eventData);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user