This commit is contained in:
COMPUTER\EDY 2026-04-29 14:38:41 +08:00
parent ab525e8d05
commit ee0f9db31e
6 changed files with 41 additions and 19 deletions

View File

@ -845,7 +845,6 @@ export default class Block extends cc.Component {
else { else {
console.log("只是重新刷一遍颜色"); console.log("只是重新刷一遍颜色");
this.initColor(true); this.initColor(true);
this.setMapColor();
} }
} }
@ -1415,7 +1414,7 @@ export default class Block extends cc.Component {
MapConroler._instance.blockLock == true MapConroler._instance.blockLock == true
|| MapConroler._instance.change_colorBlock == true || MapConroler._instance.jump_state != null || MapConroler._instance.buttonWall.length > 0) || MapConroler._instance.change_colorBlock == true || MapConroler._instance.jump_state != null || MapConroler._instance.buttonWall.length > 0)
&& !MapConroler._instance.gameOver && !MapConroler._instance.gameWin) { && !MapConroler._instance.gameOver && !MapConroler._instance.gameWin) {
console.log("!!!!!!!!!准备判死啦");
let gameover = MapConroler._instance.predict_End(true); let gameover = MapConroler._instance.predict_End(true);
if (gameover == false) { if (gameover == false) {
MapConroler._instance.failReason(); MapConroler._instance.failReason();
@ -2774,18 +2773,20 @@ export default class Block extends cc.Component {
let x = this.posX + pos.x; let x = this.posX + pos.x;
let y = this.posY + pos.y; let y = this.posY + pos.y;
MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock").block_Id = this.node.uuid; MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock").block_Id = this.node.uuid;
MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock").nowColor = this.color; if (MapConroler._instance.buttonBlock.length > 0)
MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock").nowColor = this.color;
} }
} }
} }
setMapColor() { setMapColor() {
if (this.allBlocks.length > 0) { if (this.allBlocks.length > 0 && MapConroler._instance.buttonBlock.length > 0) {
for (let i = 0; i < this.allBlocks.length; i++) { for (let i = 0; i < this.allBlocks.length; i++) {
let pos = this.allBlocks[i]; let pos = this.allBlocks[i];
let x = this.posX + pos.x; let x = this.posX + pos.x;
let y = this.posY + pos.y; let y = this.posY + pos.y;
MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock").nowColor = this.color; if (this.color && MapConroler._instance.mapBlocksWall[x][y])
MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock").nowColor = this.color;
} }
} }
MapConroler._instance.checkButton(); MapConroler._instance.checkButton();
@ -2846,7 +2847,8 @@ export default class Block extends cc.Component {
if (MapConroler._instance.mapBlocksWall[x][y]) { if (MapConroler._instance.mapBlocksWall[x][y]) {
if (MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock")) { if (MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock")) {
MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock").block_Id = ""; MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock").block_Id = "";
MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock").nowColor = -1; if (MapConroler._instance.buttonBlock.length > 0)
MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock").nowColor = -1;
} }
} }

View File

@ -450,6 +450,7 @@ export default class GameManager extends cc.Component {
data.coinAmount = 0; data.coinAmount = 0;
} }
if (levelInfo.level > data.levelAmount) { if (levelInfo.level > data.levelAmount) {
console.log("本地等级 大于服务器等级才走这里")
cc.fx.GameConfig.GM_INFO.level = levelInfo.level; cc.fx.GameConfig.GM_INFO.level = levelInfo.level;
cc.fx.GameConfig.GM_INFO.coin = coinInfo.coin; cc.fx.GameConfig.GM_INFO.coin = coinInfo.coin;
cc.fx.GameConfig.GM_INFO.freezeAmount = propInfo.freezeAmount; cc.fx.GameConfig.GM_INFO.freezeAmount = propInfo.freezeAmount;
@ -513,18 +514,30 @@ export default class GameManager extends cc.Component {
cc.fx.StorageMessage.setStorage("level", levelInfo); cc.fx.StorageMessage.setStorage("level", levelInfo);
let coinInfo = { "coin": data.coinAmount, "timestamp": timestamp }; let coinInfo = { "coin": data.coinAmount, "timestamp": timestamp };
cc.fx.StorageMessage.setStorage("coin", coinInfo); cc.fx.StorageMessage.setStorage("coin", coinInfo);
let propInfo = { if (data.forcedUpdate == true) {
"freezeAmount": data.freezeAmount, let propInfo = {
"hammerAmount": data.hammerAmount, "freezeAmount": data.freezeAmount,
"magicAmount": data.magicAmount, "hammerAmount": data.hammerAmount,
"timestamp": timestamp, "magicAmount": data.magicAmount,
"timestamp": timestamp,
}
cc.fx.GameConfig.GM_INFO.freezeAmount = data.freezeAmount;
cc.fx.GameConfig.GM_INFO.hammerAmount = data.hammerAmount;
cc.fx.GameConfig.GM_INFO.magicAmount = data.magicAmount;
cc.fx.GameConfig.GM_INFO.level = data.levelAmount;
cc.fx.GameConfig.GM_INFO.coin = data.coinAmount;
cc.fx.StorageMessage.setStorage("prop", propInfo);
// console.log("走的强制刷新", cc.fx.GameConfig.GM_INFO.hammerAmount)
} }
cc.fx.GameConfig.GM_INFO.freezeAmount = data.freezeAmount; else {
cc.fx.GameConfig.GM_INFO.hammerAmount = data.hammerAmount; cc.fx.GameConfig.GM_INFO.freezeAmount = propInfo.freezeAmount;
cc.fx.GameConfig.GM_INFO.magicAmount = data.magicAmount; cc.fx.GameConfig.GM_INFO.hammerAmount = propInfo.hammerAmount;
cc.fx.GameConfig.GM_INFO.level = data.levelAmount; cc.fx.GameConfig.GM_INFO.magicAmount = propInfo.magicAmount;
cc.fx.GameConfig.GM_INFO.coin = data.coinAmount; cc.fx.GameConfig.GM_INFO.level = data.levelAmount;
cc.fx.StorageMessage.setStorage("prop", propInfo); cc.fx.GameConfig.GM_INFO.coin = data.coinAmount;
// console.log("走的本地缓存刷新", cc.fx.GameConfig.GM_INFO.hammerAmount)
}
this.load3 = true; this.load3 = true;
this.load4 = true; this.load4 = true;
} }
@ -566,6 +579,7 @@ export default class GameManager extends cc.Component {
"magicAmount": data.magicAmount, "magicAmount": data.magicAmount,
"timestamp": timestamp, "timestamp": timestamp,
} }
console.log("不应该走到这里的的-_----------------");
cc.fx.GameConfig.GM_INFO.freezeAmount = data.freezeAmount; cc.fx.GameConfig.GM_INFO.freezeAmount = data.freezeAmount;
cc.fx.GameConfig.GM_INFO.hammerAmount = data.hammerAmount; cc.fx.GameConfig.GM_INFO.hammerAmount = data.hammerAmount;
cc.fx.GameConfig.GM_INFO.magicAmount = data.magicAmount; cc.fx.GameConfig.GM_INFO.magicAmount = data.magicAmount;

View File

@ -2326,8 +2326,10 @@ export default class MapConroler extends cc.Component {
}); });
if (colorBlock.length > 0) { if (colorBlock.length > 0) {
for (let i = 0; i < colorBlock.length; i++) { for (let i = 0; i < colorBlock.length; i++) {
if (colorBlock[i]) if (colorBlock[i]) {
colorBlock[i].getComponent("Block").changeBlockColor(); colorBlock[i].getComponent("Block").changeBlockColor();
}
} }
} }
} }

View File

@ -32,6 +32,7 @@ export default class NewClass extends cc.Component {
nowColor: number = -1; nowColor: number = -1;
onLoad() { onLoad() {
this.nowColor = -1;
// this.direction = ""; // this.direction = "";
// this.block_Id = ""; // this.block_Id = "";
} }

View File

@ -299,7 +299,7 @@ export class GameConfig {
vibrateOpen: true, //震动 vibrateOpen: true, //震动
coinnum: 0, //每局的金币数 coinnum: 0, //每局的金币数
paid_user: false, //是否是付费用户 paid_user: false, //是否是付费用户
version: "1.9.64", //版本号 version: "1.9.66", //版本号
shushu_DistinctId: "", //数数访客ID shushu_DistinctId: "", //数数访客ID
shushu_AccountId: "", //数数账号ID shushu_AccountId: "", //数数账号ID
uid: "", //用户和后端唯一id uid: "", //用户和后端唯一id

View File

@ -1437,6 +1437,9 @@ export default class Utils {
console.log("设置无尽关卡等级:", setData); console.log("设置无尽关卡等级:", setData);
Utils.POST("setUserLevel", setData, res => { Utils.POST("setUserLevel", setData, res => {
if (res.code === 1) { if (res.code === 1) {
let endLevelNum = res.data.endLevelNum;
if (parseInt(data2) < Number(endLevelNum))
cc.fx.GameConfig.GM_INFO.endLevelNum = Number(endLevelNum);
console.log("设置无尽关卡", res); console.log("设置无尽关卡", res);
if (callBack) callBack(res); if (callBack) callBack(res);
} else { } else {