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.removeFromParent();
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.removeFromParent();

View File

@ -129,11 +129,12 @@ export default class MapConroler extends cc.Component {
rightDoors: any; //右门
topDoors: any; //上门
bottomDoors: any; //下门
leftDoors: any;
powerState: boolean = false; //
SceneManager: any;
lastMagicTime: number;
opBlock: any;
leftDoors: any; //左门
powerState: boolean = false; //无限体力状态
SceneManager: any; //场景管理器
lastMagicTime: number; //上次使用魔法的时间
wall_Pass: any; //可通过门的数组
// mapInfo: number[][] = [];
@ -155,6 +156,7 @@ export default class MapConroler extends cc.Component {
this.node.parent.parent.parent.getChildByName("zhuanchang").active = false;
}
});
this.wall_Pass = [];
this.blocks = [];
this.leftDoors = []; //左门
this.rightDoors = []; //右门
@ -1629,18 +1631,18 @@ export default class MapConroler extends cc.Component {
this.reviewState = true;
cc.fx.AudioManager._instance.playEffect("anniu_Big", null);
let coin = 900;
let coin = 500;
let data = {
type: type,
coin: -coin
}
if (type == "time") {
if (cc.fx.GameConfig.GM_INFO.review == 1) coin = 1900;
else if (cc.fx.GameConfig.GM_INFO.review == 2) coin = 2500;
if (cc.fx.GameConfig.GM_INFO.review == 1) coin = 1000;
else if (cc.fx.GameConfig.GM_INFO.review == 2) coin = 1500;
}
else if (type == "boom") {
if (cc.fx.GameConfig.GM_INFO.reviewBoom == 1) coin = 1900;
else if (cc.fx.GameConfig.GM_INFO.reviewBoom == 2) coin = 2500;
if (cc.fx.GameConfig.GM_INFO.reviewBoom == 1) coin = 1000;
else if (cc.fx.GameConfig.GM_INFO.reviewBoom == 2) coin = 1500;
}
data.coin = -coin;
// console.log("自身金币:",cc.fx.GameConfig.GM_INFO.coin,"消耗金币:",coin);
@ -1787,7 +1789,7 @@ export default class MapConroler extends cc.Component {
this.stopTimeCutDown();
let time = 0;
this.gameOver = true;
if (type == "boom") {
if (type == "boom" || type == "lock") {
time = 2000;
}
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 == 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("Boom").active = true;
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 == 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);
@ -1970,7 +1977,6 @@ export default class MapConroler extends cc.Component {
}
handleBuySuccess(data) {
this.node.parent.parent.parent.getComponent("SceneManager").resetBtn();
this.updateCoin();
this.pause = false;
@ -2094,7 +2100,7 @@ export default class MapConroler extends cc.Component {
}
buyMagic() {
if (cc.fx.GameConfig.GM_INFO.coin < 1500) {
if (cc.fx.GameConfig.GM_INFO.coin < 900) {
MiniGameSdk.API.showToast("金币不足,无法购买道具");
this.node.parent.parent.parent.getComponent("SceneManager").resetBtn();
setTimeout(() => {
@ -2106,7 +2112,7 @@ export default class MapConroler extends cc.Component {
}
buyHammer() {
if (cc.fx.GameConfig.GM_INFO.coin < 1000) {
if (cc.fx.GameConfig.GM_INFO.coin < 600) {
MiniGameSdk.API.showToast("金币不足,无法购买道具");
this.node.parent.parent.parent.getComponent("SceneManager").resetBtn();
setTimeout(() => {
@ -2118,7 +2124,7 @@ export default class MapConroler extends cc.Component {
}
buyFreeze() {
if (cc.fx.GameConfig.GM_INFO.coin < 1500) {
if (cc.fx.GameConfig.GM_INFO.coin < 600) {
MiniGameSdk.API.showToast("金币不足,无法购买道具");
this.node.parent.parent.parent.getComponent("SceneManager").resetBtn();
setTimeout(() => {
@ -2783,13 +2789,63 @@ export default class MapConroler extends cc.Component {
//提前判断游戏结束
predict_End() {
console.log("提前判断游戏结束");
let count = 0;
let result = false;
for (let i = 0; i < this.blocks.length; 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;
}
if (wall_Info != null) {
this.color = wall_Info.color;
this.special = wall_Info.special;
this.color = this.wall_Info.color;
this.special = this.wall_Info.special;
this.initType();
if (wall_Info.length > 0) {
this.initColor(wall_Info.length);
if (this.wall_Info.length > 0) {
this.initColor(this.wall_Info.length);
MapConroler._instance.wall_Pass.push(this);
}
else this.node.removeComponent("cc.Sprite");
if (this.posX != null) {

View File

@ -694,9 +694,9 @@ var GameTool = {
//@ts-ignore
if (typeof wx !== 'undefined' && wx !== null) {
let num = 3;
let cost = 1500;
if (propid == 2002) {
cost = 1000;
let cost = 600;
if (propid == 2003) {
cost = 900;
num = 1;
}
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",
"uuid": "e949bfab-45c2-4e15-a2bf-afc4b26d9cb2",
"uuid": "acc20498-4f7f-4ada-907b-3f1f7aa75857",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
@ -14,9 +14,9 @@
"subMetas": {
"ditu": {
"ver": "1.0.6",
"uuid": "50e5fcf9-a6c3-43d1-8930-6f8c6b85ff92",
"uuid": "22372cf5-9d4b-4926-ace8-921c11cf8dd5",
"importer": "sprite-frame",
"rawTextureUuid": "e949bfab-45c2-4e15-a2bf-afc4b26d9cb2",
"rawTextureUuid": "acc20498-4f7f-4ada-907b-3f1f7aa75857",
"trimType": "auto",
"trimThreshold": 1,
"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,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "50e5fcf9-a6c3-43d1-8930-6f8c6b85ff92"
"__uuid__": "22372cf5-9d4b-4926-ace8-921c11cf8dd5"
},
"_type": 0,
"_sizeMode": 1,