更新开关方块功能

This commit is contained in:
COMPUTER\EDY 2026-01-05 19:06:43 +08:00
parent 03d1b35a0c
commit 55f3fd6a49
16 changed files with 327 additions and 192 deletions

View File

@ -24213,7 +24213,9 @@
{
"__uuid__": "9e768017-b9e7-4003-94dc-2f90936f098f"
},
null
{
"__uuid__": "355fefe2-cb1b-4a3c-bc18-275da1e79b67"
}
],
"liuGuang": null,
"avatarUI": {

View File

@ -175,6 +175,7 @@ export default class Block extends cc.Component {
touchDelta: cc.Vec2 = cc.v2(0, 0);
adhesiveNode: any;
checkCollision: boolean = false;
teamBlocks: any; //可移动地板块组队
//计时器
private scheduleCallback: any = null;
private scheduleCallback2: any = null;
@ -256,7 +257,7 @@ export default class Block extends cc.Component {
else if (this.type == BlockType.) {
}
}, 200);
}, 100);
@ -423,13 +424,16 @@ export default class Block extends cc.Component {
if (this.block_Info.lock != undefined && this.block_Info.lock != null) {
let switchs = cc.instantiate(MapConroler._instance.Block_Prop[14]);
switchs.parent = this.node;
switchs.opacity = this.block_Info.lock == true ? 100 : 0;
switchs.getChildByName("open").active = !this.block_Info.lock;
switchs.getChildByName("lock").active = this.block_Info.lock;
let name1 = 12 + "color" + this.block_Info.block;
let name3 = "0color" + this.block_Info.block;
let number2 = 5;
let blockSpriteFrame2 = MapConroler._instance.Block_Color[number2]._spriteFrames;
var spriteFrame3 = blockSpriteFrame2[name3];
switchs.getChildByName("icon").getComponent(cc.Sprite).spriteFrame = spriteFrame3;
let openSpriteFrame = MapConroler._instance.Block_Color[6]._spriteFrames[name1];
switchs.getChildByName("open").getComponent(cc.Sprite).spriteFrame = openSpriteFrame;
let name2 = 11 + "color" + this.block_Info.block;
let lockSpriteFrame = MapConroler._instance.Block_Color[6]._spriteFrames[name2];
switchs.getChildByName("lock").getComponent(cc.Sprite).spriteFrame = lockSpriteFrame;
let swtichsX = posConfig.pos6.x - (this.node.width * (this.node.anchorX - 0.5)); let swtichsY = posConfig.pos6.y + this.node.height / 2;
if (this.block_Info.block == 2) {
switchs.setPosition(swtichsX + 4, swtichsY - 10);
@ -857,8 +861,14 @@ export default class Block extends cc.Component {
}
// this.block_Info.node.getComponent("Block").isTouch = true;
if (this.block_Info.floor == undefined) {
MapConroler._instance.downDoor(this.block_Info.node.getComponent("Block").color, this.block_Info.node.getComponent("Block").type);
MapConroler._instance.changeRiseFall(this.block_Info.node.getComponent("Block").color, true);
if (this.block_Info.lock != undefined && this.block_Info.lock != null) {
if (this.block_Info.lock == false) MapConroler._instance.downDoor(this.block_Info.node.getComponent("Block").color, this.block_Info.node.getComponent("Block").type);
}
else {
MapConroler._instance.downDoor(this.block_Info.node.getComponent("Block").color, this.block_Info.node.getComponent("Block").type);
}
}
}
@ -878,8 +888,13 @@ export default class Block extends cc.Component {
this.relative_Position = cc.v2(this.node.x - local.x, this.node.y - local.y);
if (this.block_Info.floor == undefined) {
MapConroler._instance.changeRiseFall(this.color, true);
if (this.block_Info.lock != undefined && this.block_Info.lock != null) {
if (this.block_Info.lock == false) MapConroler._instance.downDoor(this.color, this.type);
}
else {
MapConroler._instance.downDoor(this.color, this.type);
}
}
this.setVibrate("light", 1)
if (this.hit) this.hit.active = true;
if (this.block_Info.floor) {

View File

@ -2263,13 +2263,16 @@ export default class JiaZai extends cc.Component {
cc.fx.GameConfig.GM_INFO.popPassCheck = true;
if (passCheckData && Array.isArray(passCheckData[2].free) && Array.isArray(passCheckData[2].passCheck)) {
// 给数组末尾添加激活状态1
if (passCheckData[2]) {
if (passCheckData[2].free) {
if (passCheckData[2].free.length > 0) {
const lastIndex = cc.fx.GameConfig.GM_INFO.getProgressLevel - 1;
passCheckData[2].free[lastIndex] = 1;
} else {
passCheckData[2].free.push(1);
}
}
if (passCheckData[2].passCheck) {
// 只有在通行证已激活的情况下才更新passCheck数组
if (passCheckData[2].passCheck.length > 0) {
const lastIndex = cc.fx.GameConfig.GM_INFO.getProgressLevel - 1;
@ -2279,6 +2282,8 @@ export default class JiaZai extends cc.Component {
}
}
}
}
}
else {
cc.fx.GameConfig.GM_INFO.getProgressLevel += 1;
cc.fx.GameConfig.GM_INFO.getProgress = 1;
@ -2394,18 +2399,23 @@ export default class JiaZai extends cc.Component {
if (serverTime >= time2 && serverTime < allExpire) {
let isGetItem = false;
if (passCheckLvObj.activate) {
if (passCheckLvObj.free) {
for (let i = 0; i < passCheckLvObj.free.length; i++) {
if (passCheckLvObj.free[i] == 1 || passCheckLvObj.passCheck[i] == 1) {
isGetItem = true;
}
}
}
} else {
if (passCheckLvObj.free) {
for (let i = 0; i < passCheckLvObj.free.length; i++) {
if (passCheckLvObj.free[i] == 1) {
isGetItem = true;
}
}
}
}
if (isGetItem) {
// 未领完
parsedData[1] = JSON.parse(JSON.stringify(parsedData[2]));
@ -2437,18 +2447,22 @@ export default class JiaZai extends cc.Component {
if (now < outTime) {
let isGetItem = false;
if (parsedData[1].activate) {
if (parsedData[1].free) {
for (let i = 0; i < parsedData[1].free.length; i++) {
if (parsedData[1].free[i] == 1 || parsedData[1].passCheck[i] == 1) {
isGetItem = true;
}
}
}
} else {
if (parsedData[1].free) {
for (let i = 0; i < parsedData[1].free.length; i++) {
if (parsedData[1].free[i] == 1) {
isGetItem = true;
}
}
}
}
if (isGetItem) {
cc.fx.GameConfig.GM_INFO.getItemType = 1;
} else {
@ -2522,7 +2536,6 @@ export default class JiaZai extends cc.Component {
if (this.RankNode == null && this.RankNode == undefined) {
this.LoadCareer(() => {
Utils.getSRank(res => {
debugger;
let data = JSON.parse(res.data);
let role = data.role;
let sortedArray = [];
@ -2539,6 +2552,7 @@ export default class JiaZai extends cc.Component {
// console.log("sortedArray", sortedArray);
let city = JSON.parse(JSON.stringify(cc.fx.GameConfig.CITY));
let rankData = [];
if (sortedArray) {
for (let i = 0; i < sortedArray.length; i++) {
// 检查sortedArray中的省份名称是否存在于原始data.role数据中
if (data && data[sortedArray[i].name] !== undefined) {
@ -2616,6 +2630,8 @@ export default class JiaZai extends cc.Component {
.start()
}, true)
}
}
// console.log("rankingData_________", rankData);
});
}, isShow);
@ -2647,6 +2663,7 @@ export default class JiaZai extends cc.Component {
rankingData = item.rankingData;
}
})
if (rankingData) {
if (rankingData.length >= 8) {
let jg = false;
for (let j = 0; j < 8; j++) {
@ -2671,6 +2688,8 @@ export default class JiaZai extends cc.Component {
else {
// rankingData.push(selfData)
}
}
// console.log("修改后", rankData);
}
@ -2678,9 +2697,11 @@ export default class JiaZai extends cc.Component {
if (cc.fx.GameConfig.GM_INFO.addLevel > 4) {
this.addSelfToRank(this.careerRank.rankData);
}
if (this.careerRank.rankData) {
for (let i = 0; i < this.careerRank.rankData.length; i++) {
this.careerRank.rankData[i].rank = i + 1;
}
}
if (this.RankNode != null && this.RankNode != undefined) {
this.RankNode.opacity = 0;
this.RankNode.zIndex = 3;

View File

@ -38,13 +38,13 @@ export default class NewClass extends cc.Component {
// let version = cc.fx.GameTool.getWechatGameVersion();
// if (version == "开发版" || version == "体验版") {
// cc.debug.setDisplayStats(true);
// cc.debug.setDisplayStats(false);
// }
// else if (version == "正式版") {
// cc.debug.setDisplayStats(false);
// }
// else {
// cc.debug.setDisplayStats(true);
// cc.debug.setDisplayStats(false);
// }
//this.SubContext();

View File

@ -173,6 +173,7 @@ export default class MapConroler extends cc.Component {
longAndShortWall: any;
adhesiveBlock: any[];
barrierBlock: any[];
teamBlocks: any[]; //可移动地板块组队
// mapInfo: number[][] = [];
getProgressLevel: number = 0;
getProgress: number = 0;
@ -209,6 +210,7 @@ export default class MapConroler extends cc.Component {
this.blocks = [];
this.adhesiveBlock = []; //粘合快数组
this.barrierBlock = [];
this.teamBlocks = []; //可移动地板块组队
this.leftDoors = []; //左门
this.rightDoors = []; //右门
this.topDoors = []; //上门
@ -673,6 +675,23 @@ export default class MapConroler extends cc.Component {
if (blockInfo.floor) {
info["floor"] = blockInfo.floor;
if (blockInfo.floorTime) info["floorTime"] = blockInfo.floorTime;
if (blockInfo.floorMove != undefined && blockInfo.floorMove != null) {
if (blockInfo.floorMove == true) {
//如果数组没有,是新的
if (this.teamBlocks.length == 0) this.teamBlocks.push(block);
else {
//如果数组内有,则判断是不是在同一个地板下
if (this.teamBlocks[0].floor == blockInfo.floor) {
this.teamBlocks.push(block);
}
//不在同一个地板下
else {
this.teamBlocks = [];
this.teamBlocks.push(block);
}
}
}
}
}
@ -683,8 +702,8 @@ export default class MapConroler extends cc.Component {
blockUp.setPosition(cc.v2(info.position.x, info.position.y));
block.getComponent("Block").init(blockInfo, null, null, blockUp);
blockUp.getComponent("Block").init(info, null, null, block);
block.getComponent("Block").init(blockInfo, null, null, blockUp, null, this.teamBlocks);
blockUp.getComponent("Block").init(info, null, null, block, null, this.teamBlocks);
if (info.color != 11) {
this.blocks.push(blockUp);
this.blockNum += 1;
@ -703,16 +722,17 @@ export default class MapConroler extends cc.Component {
blockUp.setPosition(cc.v2(info.position.x, info.position.y));
block.getComponent("Block").init(blockInfo, null, null, blockUp, false);
block.getComponent("Block").init(blockInfo, null, null, blockUp, false, this.teamBlocks);
setTimeout(() => {
blockUp.getComponent("Block").init(info, null, null, block, true);
blockUp.getComponent("Block").init(info, null, null, block, true, this.teamBlocks);
}, 100);
if (info.color != 11) {
this.blocks.push(blockUp);
this.blockNum += 1;
}
} else {
block.getComponent("Block").init(blockInfo);
block.getComponent("Block").init(blockInfo, null, null, null, null, this.teamBlocks);
}
}
else {

View File

@ -553,16 +553,16 @@ export default class Wall extends cc.Component {
// console.log("变色门变色数组数量", this.colorArray, this.node.uuid);
if (this.colorArray.length >= 1 && this.color == this.colorArray[0]) {
let firstItem = this.colorArray.shift(); // 移除第一项
console.log("移除颜色:", this.color);
// console.log("移除颜色:", this.color);
// this.colorArray.push(firstItem); // 将第一项添加到数组末尾
if (this.colorArray.length <= 2) {
for (let i = 0; i < this.colorStartArray.length; i++) {
this.colorArray.push(this.colorStartArray[i]);
console.log("将颜色放入数组:", this.colorStartArray[i])
// console.log("将颜色放入数组:", this.colorStartArray[i])
}
}
}
console.log("变色门变色数组数量", this.colorArray, this.node.uuid);
// console.log("变色门变色数组数量", this.colorArray, this.node.uuid);
this.updateColor();
}

View File

@ -426,8 +426,8 @@ var GameTool = {
//关卡上限
maxLevel() {
let jg = false;
if (cc.fx.GameConfig.GM_INFO.level > 889) {
cc.fx.GameConfig.GM_INFO.level = 890;
if (cc.fx.GameConfig.GM_INFO.level > 919) {
cc.fx.GameConfig.GM_INFO.level = 920;
jg = true;
}
return jg;

View File

@ -45,10 +45,12 @@ export default class Question extends cc.Component {
if (this.node) {
if (this.node.parent) {
if (this.node.parent.getComponent("Block").block_Info.lock == false) {
this.node.opacity = 100;
this.node.getChildByName("lock").active = true;
this.node.getChildByName("open").active = false;
}
else {
this.node.opacity = 0;
this.node.getChildByName("lock").active = false;
this.node.getChildByName("open").active = true;
}
this.node.parent.getComponent("Block").block_Info.lock = !this.node.parent.getComponent("Block").block_Info.lock;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 467 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 395 KiB

View File

@ -1,38 +0,0 @@
{
"ver": "2.3.7",
"uuid": "669a5a6c-68ca-412c-9321-a0af32085234",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 970,
"height": 1210,
"platformSettings": {},
"subMetas": {
"result_bg2": {
"ver": "1.0.6",
"uuid": "f54b3295-ab32-4dce-bb2a-79ed327a45e2",
"importer": "sprite-frame",
"rawTextureUuid": "669a5a6c-68ca-412c-9321-a0af32085234",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 970,
"height": 1210,
"rawWidth": 970,
"rawHeight": 1210,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

View File

@ -24,20 +24,23 @@
"__id__": 5
},
{
"__id__": 7
"__id__": 8
},
{
"__id__": 10
}
],
"_active": true,
"_components": [
{
"__id__": 10
"__id__": 13
},
{
"__id__": 11
"__id__": 14
}
],
"_prefab": {
"__id__": 12
"__id__": 15
},
"_opacity": 255,
"_color": {
@ -88,13 +91,13 @@
},
{
"__type__": "cc.Node",
"_name": "icon",
"_name": "open",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 3
@ -191,6 +194,111 @@
"fileId": "48vFumJApBjb/xUEZIhVH6",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "lock",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 6
}
],
"_prefab": {
"__id__": 7
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 120,
"height": 120
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "12m9Xu8dxPDpc7zj3A7xOB",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "time",
@ -202,7 +310,7 @@
"_active": false,
"_components": [],
"_prefab": {
"__id__": 6
"__id__": 9
},
"_opacity": 255,
"_color": {
@ -273,11 +381,11 @@
"_active": false,
"_components": [
{
"__id__": 8
"__id__": 11
}
],
"_prefab": {
"__id__": 9
"__id__": 12
},
"_opacity": 255,
"_color": {
@ -331,7 +439,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
"__id__": 10
},
"_enabled": true,
"_materials": [

View File

@ -94,6 +94,11 @@
"level": 849,
"name": "daoju18",
"tips": "定次炸弹块第一次出现"
},
{
"level": 903,
"name": "daoju19",
"tips": "铁皮方块第一次出现"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -1,6 +1,6 @@
{
"ver": "2.3.7",
"uuid": "cf67e4b5-6705-4eb0-809f-69efa4a5883e",
"uuid": "782aac06-a49c-48e1-b9eb-aceecf649d42",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
@ -8,15 +8,15 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 972,
"height": 1474,
"width": 744,
"height": 786,
"platformSettings": {},
"subMetas": {
"result_bg1": {
"daoju19": {
"ver": "1.0.6",
"uuid": "0f30eac9-1adc-4b68-9233-90b1d87de750",
"uuid": "4937f794-68b7-4040-8c4c-22aca68989f4",
"importer": "sprite-frame",
"rawTextureUuid": "cf67e4b5-6705-4eb0-809f-69efa4a5883e",
"rawTextureUuid": "782aac06-a49c-48e1-b9eb-aceecf649d42",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
@ -24,10 +24,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 972,
"height": 1474,
"rawWidth": 972,
"rawHeight": 1474,
"width": 744,
"height": 786,
"rawWidth": 744,
"rawHeight": 786,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,

View File

@ -1,5 +1,5 @@
{
"last-module-event-record-time": 1766999892289,
"last-module-event-record-time": 1767604715685,
"group-list": [
"default",
"Map"