更新配置和代码

This commit is contained in:
COMPUTER\EDY 2026-02-10 17:22:09 +08:00
parent dec5f2a745
commit 561c06172e
6 changed files with 101 additions and 42 deletions

View File

@ -685,6 +685,7 @@ export default class JiaZai extends cc.Component {
}); });
rightElements2.forEach(elementName => { rightElements2.forEach(elementName => {
let element; let element;
element = loadNode.getChildByName("Top").getChildByName(elementName); element = loadNode.getChildByName("Top").getChildByName(elementName);
if (element) { if (element) {
@ -2918,6 +2919,16 @@ export default class JiaZai extends cc.Component {
} }
guideHammerAnimation() { guideHammerAnimation() {
if (this.node == undefined || this.node == null) {
return;
}
if (this.node.getChildByName("Load") == undefined || this.node.getChildByName("Load") == null) {
return;
}
if (this.node.getChildByName("Load").getChildByName("Top") == undefined || this.node.getChildByName("Load").getChildByName("Top") == null) {
return;
}
let loadNode = this.node.getChildByName("Load"); let loadNode = this.node.getChildByName("Load");
if (!loadNode) return; if (!loadNode) return;

View File

@ -692,11 +692,13 @@ export default class MapConroler extends cc.Component {
const MAX_PER_FRAME = 10; // 每帧最大创建数量 const MAX_PER_FRAME = 10; // 每帧最大创建数量
const MIN_PER_FRAME = 1; // 每帧最小创建数量 const MIN_PER_FRAME = 1; // 每帧最小创建数量
let nianHe = false; let nianHe = false;
const createBlocks = () => { const createBlocks = () => {
const startTime = performance.now(); const startTime = performance.now();
for (let i = 0; i < BLOCKS_PER_FRAME && index < blockArray.length; i++) { for (let i = 0; i < BLOCKS_PER_FRAME && index < blockArray.length; i++) {
let blockInfo = blockArray[index]; let blockInfo = blockArray[index];
if (blockInfo == undefined || blockInfo == null) continue;
if (blockInfo.block == undefined || blockInfo.block == null) continue;
// 缓存 Block_Array 访问 // 缓存 Block_Array 访问
const blockPrefab = this.Block_Array[blockInfo.block]; const blockPrefab = this.Block_Array[blockInfo.block];
let block = cc.instantiate(blockPrefab); let block = cc.instantiate(blockPrefab);
@ -743,18 +745,20 @@ export default class MapConroler extends cc.Component {
continue; continue;
} }
index++; index++;
let info = blockArray[index]; let info2 = blockArray[index];
if (info2 == undefined || info2 == null) continue;
if (info2.block == undefined || info2.block == null) continue;
// 缓存 Block_Array 访问 // 缓存 Block_Array 访问
const blockUpPrefab = this.Block_Array[info.block]; const blockUpPrefab = this.Block_Array[info2.block];
let blockUp = cc.instantiate(blockUpPrefab); let blockUp = cc.instantiate(blockUpPrefab);
blockUp.parent = this.node; blockUp.parent = this.node;
blockUp.setPosition(cc.v2(info.position.x, info.position.y)); blockUp.setPosition(cc.v2(info2.position.x, info2.position.y));
block.getComponent("Block").init(blockInfo, null, null, blockUp, false); block.getComponent("Block").init(blockInfo, null, null, blockUp, false);
setTimeout(() => { setTimeout(() => {
blockUp.getComponent("Block").init(info, null, null, block, true); blockUp.getComponent("Block").init(info2, null, null, block, true);
}, 100); }, 100);
if (info.color != 11) { if (info2.color != 11) {
this.blocks.push(blockUp); this.blocks.push(blockUp);
this.blockNum += 1; this.blockNum += 1;
} }

View File

@ -132,13 +132,13 @@ export default class AudioManager extends cc.Component {
cc.audioEngine.setEffectsVolume(1); cc.audioEngine.setEffectsVolume(1);
} }
var context = cc.audioEngine.playEffect(audioSource, loop); var context = cc.audioEngine.playEffect(audioSource, loop);
if (callback) { // if (callback) {
cc.audioEngine.setFinishCallback(context, function () { // cc.audioEngine.setFinishCallback(context, function () {
if (this && callback) { // if (this && callback) {
callback.call(this); // callback.call(this);
} // }
}.bind(this)); // }.bind(this));
} // }
// cc.wwx.OutPut.log('play audio effect isBrowser: ' + context.src); // cc.wwx.OutPut.log('play audio effect isBrowser: ' + context.src);
this.mAudioMap[audioSource] = context; this.mAudioMap[audioSource] = context;

View File

@ -450,8 +450,8 @@ var GameTool = {
//关卡上限 //关卡上限
maxLevel() { maxLevel() {
let jg = false; let jg = false;
if (cc.fx.GameConfig.GM_INFO.level > 1109) { if (cc.fx.GameConfig.GM_INFO.level > 1149) {
cc.fx.GameConfig.GM_INFO.level = 1110; cc.fx.GameConfig.GM_INFO.level = 1150;
jg = true; jg = true;
} }
return jg; return jg;
@ -2097,9 +2097,44 @@ var GameTool = {
if (error == null) { if (error == null) {
return; return;
} }
if (error.message == null || error.message == "null" || error.message == "" || error.message == undefined || error.message == "(null)") { if (error.message == undefined || error.message == null || error.message == "null" || error.message == "" || error.message == "(null)") {
return; return;
} }
if (error.message.includes("null is not an object (evaluating 't._components.length')")) {
return;
}
else if (error.message.includes("o.call is not a function. (In 'o.call(this)', 'o.call' is undefined)")) {
return;
}
else if (error.message.includes("null is not an object (evaluating 't.node.parent')")) {
return;
}
else if (error.message.includes("please go to https://github.com/")) {
return;
}
else if (error.message.includes("null is not an object(evaluating 'a.block Info.node)")) {
return;
}
else if (error.message.includes("Cannot read properties of null (reading 'length')")) {
return;
}
else if (error.message.includes("null is not an object (evaluating 'this.node.getChildByName')")) {
return;
}
else if (error.message.includes("null is not an object(evaluating 'n.setPosition')")) {
return;
}
else if (error.message.includes("")) {
return;
}
else if (error.message.includes("")) {
return;
}
else if (error.message.includes("")) {
return;
}
console.log("_____________________上报错误"); console.log("_____________________上报错误");
if (!cc.fx.GameConfig.GM_INFO.error_message.includes(error.message)) { if (!cc.fx.GameConfig.GM_INFO.error_message.includes(error.message)) {
cc.fx.GameConfig.GM_INFO.error_message.push(error.message); cc.fx.GameConfig.GM_INFO.error_message.push(error.message);
@ -2109,9 +2144,10 @@ var GameTool = {
//@ts-ignore //@ts-ignore
wx.offError(); wx.offError();
} }
let errorData = { let errorData = {
error_type: "javascript", error_type: "javascript",
error_message: error.message || 'null', error_message: error.message,
error_scene: cc.fx.GameConfig.GM_INFO?.sceneValue || 'null', error_scene: cc.fx.GameConfig.GM_INFO?.sceneValue || 'null',
error_stack: error.stack || '', error_stack: error.stack || '',
game_version: cc.fx.GameConfig.GM_INFO?.version || 'unknown', game_version: cc.fx.GameConfig.GM_INFO?.version || 'unknown',

View File

@ -45,6 +45,10 @@ export default class Boom extends cc.Component {
this.node.getChildByName("time").children[0].x -= 2; this.node.getChildByName("time").children[0].x -= 2;
this.node.getChildByName("time").children[0].x -= 3; this.node.getChildByName("time").children[0].x -= 3;
} }
if (this.time <= 2) {
this.node.getChildByName("time").children[0].scale *= 1.25;
this.node.getChildByName("time").children[0].color = cc.Color.RED;
}
} }
// this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString(); // this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString();
} }
@ -70,8 +74,8 @@ export default class Boom extends cc.Component {
if (this.time <= 0) { if (this.time <= 0) {
this.time = 0; this.time = 0;
this.gameOver = true; this.gameOver = true;
} }
NumberToImage.numberToImageNodes(this.time, 30, 8, "half_black_", this.node.getChildByName("time"), false); NumberToImage.numberToImageNodes(this.time, 30, 8, "half_black_", this.node.getChildByName("time"), false);
cc.fx.GameTool.numberScaleAction(this.node.getChildByName("time").children[0]); cc.fx.GameTool.numberScaleAction(this.node.getChildByName("time").children[0]);
if (this.node.getChildByName("time").children.length > 1) { if (this.node.getChildByName("time").children.length > 1) {
@ -80,6 +84,10 @@ export default class Boom extends cc.Component {
this.node.getChildByName("time").children[0].x -= 2; this.node.getChildByName("time").children[0].x -= 2;
this.node.getChildByName("time").children[0].x -= 3; this.node.getChildByName("time").children[0].x -= 3;
} }
if (this.time <= 2) {
this.node.getChildByName("time").children[0].scale *= 1.25;
this.node.getChildByName("time").children[0].color = cc.Color.RED;
}
if (this.time <= 0) { if (this.time <= 0) {
const mockTouchEvent = { const mockTouchEvent = {
getLocation: () => { getLocation: () => {

View File

@ -30,32 +30,32 @@ export default class CardFlipEffect extends cc.Component {
} }
start() { start() {
this.node.opacity = 255; // this.node.opacity = 255;
// 初始化材质参数 // // 初始化材质参数
if (this.material) { // if (this.material) {
this.updateMaterialProperties(); // this.updateMaterialProperties();
} // }
setTimeout(() => { // setTimeout(() => {
cc.tween(this.node.parent) // cc.tween(this.node.parent)
.to(2, { y: 400 }, { easing: 'quadOut' }) // .to(2, { y: 400 }, { easing: 'quadOut' })
.start(); // .start();
this.startFlip(); // this.startFlip();
}, 5000); // }, 5000);
this.node.parent.getChildByName("dayinji3").opacity = 255; // this.node.parent.getChildByName("dayinji3").opacity = 255;
cc.tween(this.node.parent) // cc.tween(this.node.parent)
.to(0.5, { y: 3500 }) // .to(0.5, { y: 3500 })
.call(() => { // .call(() => {
this.node.parent.getChildByName("dayinji3").opacity = 0; // this.node.parent.getChildByName("dayinji3").opacity = 0;
}) // })
.to(2, { y: 1940 }) // .to(2, { y: 1940 })
.call(() => { // .call(() => {
this.node.y = 400; // this.node.y = 400;
this.node.opacity = 255; // this.node.opacity = 255;
this.node.active = true; // this.node.active = true;
}) // })
.start(); // .start();
} }