This commit is contained in:
YZ\249929363 2025-07-25 15:18:46 +08:00
parent fa699bc8c3
commit 3cfa725e71
12 changed files with 4631 additions and 3777 deletions

File diff suppressed because it is too large Load Diff

View File

@ -604,7 +604,10 @@ export default class Block extends cc.Component {
this.node.active = false; this.node.active = false;
this.node.removeFromParent(); this.node.removeFromParent();
if (type == true && MapConroler._instance.openWall.length > 0) { if (type == true && MapConroler._instance.openWall.length > 0) {
MapConroler._instance.predict_End(); let gameover = MapConroler._instance.predict_End();
if (gameover == false) {
MapConroler._instance.failLevel("lock");
}
} }
// this.node.active = false; // this.node.active = false;
// this.node.removeFromParent(); // this.node.removeFromParent();

View File

@ -129,11 +129,12 @@ export default class MapConroler extends cc.Component {
rightDoors: any; //右门 rightDoors: any; //右门
topDoors: any; //上门 topDoors: any; //上门
bottomDoors: any; //下门 bottomDoors: any; //下门
leftDoors: any; leftDoors: any; //左门
powerState: boolean = false; // powerState: boolean = false; //无限体力状态
SceneManager: any; SceneManager: any; //场景管理器
lastMagicTime: number; lastMagicTime: number; //上次使用魔法的时间
opBlock: any; wall_Pass: any; //可通过门的数组
// mapInfo: number[][] = []; // mapInfo: number[][] = [];
@ -155,6 +156,7 @@ export default class MapConroler extends cc.Component {
this.node.parent.parent.parent.getChildByName("zhuanchang").active = false; this.node.parent.parent.parent.getChildByName("zhuanchang").active = false;
} }
}); });
this.wall_Pass = [];
this.blocks = []; this.blocks = [];
this.leftDoors = []; //左门 this.leftDoors = []; //左门
this.rightDoors = []; //右门 this.rightDoors = []; //右门
@ -1629,18 +1631,18 @@ export default class MapConroler extends cc.Component {
this.reviewState = true; this.reviewState = true;
cc.fx.AudioManager._instance.playEffect("anniu_Big", null); cc.fx.AudioManager._instance.playEffect("anniu_Big", null);
let coin = 900; let coin = 500;
let data = { let data = {
type: type, type: type,
coin: -coin coin: -coin
} }
if (type == "time") { if (type == "time") {
if (cc.fx.GameConfig.GM_INFO.review == 1) coin = 1900; if (cc.fx.GameConfig.GM_INFO.review == 1) coin = 1000;
else if (cc.fx.GameConfig.GM_INFO.review == 2) coin = 2500; else if (cc.fx.GameConfig.GM_INFO.review == 2) coin = 1500;
} }
else if (type == "boom") { else if (type == "boom") {
if (cc.fx.GameConfig.GM_INFO.reviewBoom == 1) coin = 1900; if (cc.fx.GameConfig.GM_INFO.reviewBoom == 1) coin = 1000;
else if (cc.fx.GameConfig.GM_INFO.reviewBoom == 2) coin = 2500; else if (cc.fx.GameConfig.GM_INFO.reviewBoom == 2) coin = 1500;
} }
data.coin = -coin; data.coin = -coin;
// console.log("自身金币:",cc.fx.GameConfig.GM_INFO.coin,"消耗金币:",coin); // console.log("自身金币:",cc.fx.GameConfig.GM_INFO.coin,"消耗金币:",coin);
@ -1787,7 +1789,7 @@ export default class MapConroler extends cc.Component {
this.stopTimeCutDown(); this.stopTimeCutDown();
let time = 0; let time = 0;
this.gameOver = true; this.gameOver = true;
if (type == "boom") { if (type == "boom" || type == "lock") {
time = 2000; time = 2000;
} }
setTimeout(() => { setTimeout(() => {
@ -1802,7 +1804,7 @@ export default class MapConroler extends cc.Component {
else if (cc.fx.GameConfig.GM_INFO.review == 1) buyBtn.getChildByName("coin2").active = true; else if (cc.fx.GameConfig.GM_INFO.review == 1) buyBtn.getChildByName("coin2").active = true;
else if (cc.fx.GameConfig.GM_INFO.review == 2) buyBtn.getChildByName("coin3").active = true; else if (cc.fx.GameConfig.GM_INFO.review == 2) buyBtn.getChildByName("coin3").active = true;
} }
if (type == "boom") { else if (type == "boom") {
this.node.parent.parent.getChildByName("Lose").getChildByName("Time").active = false; this.node.parent.parent.getChildByName("Lose").getChildByName("Time").active = false;
this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").active = true; this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").active = true;
let buyBtn = this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").getChildByName("buyBtn"); let buyBtn = this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").getChildByName("buyBtn");
@ -1811,6 +1813,11 @@ export default class MapConroler extends cc.Component {
else if (cc.fx.GameConfig.GM_INFO.reviewBoom == 1) buyBtn.getChildByName("coin2").active = true; else if (cc.fx.GameConfig.GM_INFO.reviewBoom == 1) buyBtn.getChildByName("coin2").active = true;
else if (cc.fx.GameConfig.GM_INFO.reviewBoom == 2) buyBtn.getChildByName("coin3").active = true; else if (cc.fx.GameConfig.GM_INFO.reviewBoom == 2) buyBtn.getChildByName("coin3").active = true;
} }
else if (type == "lock") {
this.node.parent.parent.getChildByName("Lose").getChildByName("Time").active = false;
this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").active = false;
this.node.parent.parent.getChildByName("Lose").getChildByName("Lock").active = true;
}
} }
}, time); }, time);
@ -1970,7 +1977,6 @@ export default class MapConroler extends cc.Component {
} }
handleBuySuccess(data) { handleBuySuccess(data) {
this.node.parent.parent.parent.getComponent("SceneManager").resetBtn(); this.node.parent.parent.parent.getComponent("SceneManager").resetBtn();
this.updateCoin(); this.updateCoin();
this.pause = false; this.pause = false;
@ -2094,7 +2100,7 @@ export default class MapConroler extends cc.Component {
} }
buyMagic() { buyMagic() {
if (cc.fx.GameConfig.GM_INFO.coin < 1500) { if (cc.fx.GameConfig.GM_INFO.coin < 900) {
MiniGameSdk.API.showToast("金币不足,无法购买道具"); MiniGameSdk.API.showToast("金币不足,无法购买道具");
this.node.parent.parent.parent.getComponent("SceneManager").resetBtn(); this.node.parent.parent.parent.getComponent("SceneManager").resetBtn();
setTimeout(() => { setTimeout(() => {
@ -2106,7 +2112,7 @@ export default class MapConroler extends cc.Component {
} }
buyHammer() { buyHammer() {
if (cc.fx.GameConfig.GM_INFO.coin < 1000) { if (cc.fx.GameConfig.GM_INFO.coin < 600) {
MiniGameSdk.API.showToast("金币不足,无法购买道具"); MiniGameSdk.API.showToast("金币不足,无法购买道具");
this.node.parent.parent.parent.getComponent("SceneManager").resetBtn(); this.node.parent.parent.parent.getComponent("SceneManager").resetBtn();
setTimeout(() => { setTimeout(() => {
@ -2118,7 +2124,7 @@ export default class MapConroler extends cc.Component {
} }
buyFreeze() { buyFreeze() {
if (cc.fx.GameConfig.GM_INFO.coin < 1500) { if (cc.fx.GameConfig.GM_INFO.coin < 600) {
MiniGameSdk.API.showToast("金币不足,无法购买道具"); MiniGameSdk.API.showToast("金币不足,无法购买道具");
this.node.parent.parent.parent.getComponent("SceneManager").resetBtn(); this.node.parent.parent.parent.getComponent("SceneManager").resetBtn();
setTimeout(() => { setTimeout(() => {
@ -2783,13 +2789,63 @@ export default class MapConroler extends cc.Component {
//提前判断游戏结束 //提前判断游戏结束
predict_End() { predict_End() {
console.log("提前判断游戏结束"); console.log("提前判断游戏结束");
let count = 0; let result = false;
for (let i = 0; i < this.blocks.length; i++) { for (let i = 0; i < this.blocks.length; i++) {
//确保方块是可移动状态下再做判断 //确保方块是可移动状态下再做判断
if (this.blockCanMove(this.blocks[i])) { if (this.blockCanMove(this.blocks[i])) {
let color = this.blocks[i].getComponent("Block").color;
for (let j = 0; j < this.wall_Pass.length; j++) {
//如果颜色相同
if (this.wall_Pass[j].color == color) {
//星星块特殊判断
if (this.blocks[i].getComponent("Block").type == 5) {
console.log("星星块,判断是否可通行");
if (this.wall_Pass[j].special == 1) {
console.log("星星门,可通行");
result = this.blockCanPass(this.blocks[i], this.wall_Pass[j]);
if (result == true)
return result;
}
else {
console.log("普通门,不可通行");
continue;
}
}
else {
if (this.wall_Pass[j].special == 2) {
if (this.wall_Pass[j].open == true) {
console.log("开关门并且开着");
result = this.blockCanPass(this.blocks[i], this.wall_Pass[j]);
if (result == true)
return result;
}
else {
console.log("开关门并且关着,________不可通行");
continue;
}
}
else if (this.wall_Pass[j].special == 3) {
console.log("冻结门,不可通行");
continue;
}
else {
console.log("普通门,判断是否可通行");
result = this.blockCanPass(this.blocks[i], this.wall_Pass[j]);
if (result == true)
return result;
}
}
}
}
}
}
return result;
}
} //判断方块是否可以正常通过门
} blockCanPass(block, wall) {
let jg = false;
return jg;
} }
//判断方块是否是可移动类型 //判断方块是否是可移动类型

View File

@ -150,11 +150,12 @@ export default class Wall extends cc.Component {
//this.node.getChildByName("num").getComponent(cc.Label).string = ":" + this.node.parent.zIndex; //this.node.getChildByName("num").getComponent(cc.Label).string = ":" + this.node.parent.zIndex;
} }
if (wall_Info != null) { if (wall_Info != null) {
this.color = wall_Info.color; this.color = this.wall_Info.color;
this.special = wall_Info.special; this.special = this.wall_Info.special;
this.initType(); this.initType();
if (wall_Info.length > 0) { if (this.wall_Info.length > 0) {
this.initColor(wall_Info.length); this.initColor(this.wall_Info.length);
MapConroler._instance.wall_Pass.push(this);
} }
else this.node.removeComponent("cc.Sprite"); else this.node.removeComponent("cc.Sprite");
if (this.posX != null) { if (this.posX != null) {

View File

@ -694,9 +694,9 @@ var GameTool = {
//@ts-ignore //@ts-ignore
if (typeof wx !== 'undefined' && wx !== null) { if (typeof wx !== 'undefined' && wx !== null) {
let num = 3; let num = 3;
let cost = 1500; let cost = 600;
if (propid == 2002) { if (propid == 2003) {
cost = 1000; cost = 900;
num = 1; num = 1;
} }
cc.fx.GameTool.changeCoin(-cost); cc.fx.GameTool.changeCoin(-cost);

BIN
assets/shop/img/ditu.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -1,6 +1,6 @@
{ {
"ver": "2.3.7", "ver": "2.3.7",
"uuid": "e949bfab-45c2-4e15-a2bf-afc4b26d9cb2", "uuid": "acc20498-4f7f-4ada-907b-3f1f7aa75857",
"importer": "texture", "importer": "texture",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
@ -14,9 +14,9 @@
"subMetas": { "subMetas": {
"ditu": { "ditu": {
"ver": "1.0.6", "ver": "1.0.6",
"uuid": "50e5fcf9-a6c3-43d1-8930-6f8c6b85ff92", "uuid": "22372cf5-9d4b-4926-ace8-921c11cf8dd5",
"importer": "sprite-frame", "importer": "sprite-frame",
"rawTextureUuid": "e949bfab-45c2-4e15-a2bf-afc4b26d9cb2", "rawTextureUuid": "acc20498-4f7f-4ada-907b-3f1f7aa75857",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 271 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 920 KiB

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 KiB

After

Width:  |  Height:  |  Size: 77 KiB

View File

@ -175,7 +175,7 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "50e5fcf9-a6c3-43d1-8930-6f8c6b85ff92" "__uuid__": "22372cf5-9d4b-4926-ace8-921c11cf8dd5"
}, },
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 1,