Compare commits

...

4 Commits

Author SHA1 Message Date
computer\尼卡 0c1fa52444 提交 2025-07-23 11:10:15 +08:00
computer\尼卡 0b3cd8fb78 Merge branch 'main' of https://git.sparkus.cn/yangzhao/cb 2025-07-23 10:54:59 +08:00
computer\尼卡 20ba317248 Merge branch 'main' of https://git.sparkus.cn/yangzhao/cb
# Conflicts:
#	assets/Scene/GameScene.fire
2025-07-22 19:00:41 +08:00
computer\尼卡 907a7cca5b 提交 2025-07-22 18:57:20 +08:00
18 changed files with 11853 additions and 6191 deletions

File diff suppressed because it is too large Load Diff

View File

@ -150,7 +150,9 @@ export default class Block extends cc.Component {
touchDelta: cc.Vec2 = cc.v2(0, 0);
adhesiveNode: any;
checkCollision: boolean = false;
//计时器
private scheduleCallback: any = null;
private scheduleCallback2: any = null;
onLoad() {
@ -745,13 +747,10 @@ export default class Block extends cc.Component {
}
eliminate() {
clearTimeout(this.scheduleCallback2);
clearTimeout(this.scheduleCallback);
//锤子状态消失
MapConroler._instance.pause = true;
console.log(this.node.x, this.node.y, 'weizhi', this.node)
if (MapConroler._instance.ishammer || MapConroler._instance.ismagic) {
}
if (MapConroler._instance.ishammer == true) {
let parentSize = this.node.getContentSize();
console.log("锤子状态消除", this.node.position);
@ -769,6 +768,37 @@ export default class Block extends cc.Component {
pos = cc.v3(this.node.position.x - parentSize.width / 6,
this.node.position.y + parentSize.height / 2, 0)
}
//name等于个别
switch (this.node.name) {
case "block21":
pos = cc.v3(this.node.position.x - parentSize.width / 4,
this.node.position.y + parentSize.height / 2, 0)
break;
case "block16":
pos = cc.v3(this.node.position.x - parentSize.width / 6,
this.node.position.y + parentSize.height / 2, 0)
case "block10":
pos = cc.v3(this.node.position.x - parentSize.width / 4,
this.node.position.y + parentSize.height / 2, 0)
break;
case "block8":
pos = cc.v3(this.node.position.x - parentSize.width / 6 - parentSize.width / 2,
this.node.position.y + parentSize.height / 2, 0)
break;
case "block22":
pos = cc.v3(this.node.position.x - parentSize.width / 4,
this.node.position.y + parentSize.height - parentSize.height / 4, 0)
break;
case "block20":
pos = cc.v3(this.node.position.x - parentSize.height + parentSize.height / 4,
this.node.position.y + parentSize.height / 2, 0)
break;
case "block6":
pos = cc.v3(this.node.position.x - parentSize.width / 4,
this.node.position.y + parentSize.height / 2, 0)
break;
}
MapConroler._instance.startHammer(pos);
setTimeout(() => {
@ -782,10 +812,10 @@ export default class Block extends cc.Component {
this.node.getChildByName("lock").getComponent("Lock").reduce();
return;
}
}, 1800);
}, 1200);
}
if (MapConroler._instance.ismagic) {
setTimeout(() => {
this.scheduleCallback = setTimeout(() => {
// 记录添加magic时的锚点
this.node.anchorX = 0.5;
this.node.anchorY = 0.5;
@ -831,6 +861,7 @@ export default class Block extends cc.Component {
effectNode.addComponent(sp.Skeleton);
effectNode.getComponent(sp.Skeleton).skeletonData = this.magic_SkeletonData;
effectNode.getComponent(sp.Skeleton).setAnimation(0, "play", false);
if (this.type == BlockType.) {
this.node.getChildByName("freeze").getComponent("Freeze").reduce(2);
MapConroler._instance.ismagic = false;
@ -841,7 +872,15 @@ export default class Block extends cc.Component {
this.node.getChildByName("lock").getComponent("Lock").reduce();
return;
}
}, 1800);
}, 800);
// this.scheduleCallback = setTimeout(() => {
// function ()
// }, timeout); {
// };
// this.stopTimeCutDown();
// this.schedule(this.scheduleCallback, 0.6);
console.log("111")
}
if (this.type == BlockType. && (!MapConroler._instance.ishammer && !MapConroler._instance.ismagic)) {
@ -853,8 +892,8 @@ export default class Block extends cc.Component {
return;
}
//如果方块是有特殊状态,则特殊处理
let time = 1200;
let time2 = 2000;
let time = 900;
let time2 = 950;
let tim = 200;
if (MapConroler._instance.ishammer) {
tim = time
@ -862,15 +901,13 @@ export default class Block extends cc.Component {
tim = time2
}
if (MapConroler._instance.hammer == true) MapConroler._instance.hammer = false;
setTimeout(() => {
this.scheduleCallback2= setTimeout(() => {
//如果方块可以消除
MapConroler._instance.blockNum -= 1;
MapConroler._instance.special_Treatment(this.node);
var self = this;
this.removeMapBlock();
MapConroler._instance.judgeWin(1);
let pos = this.node.getPosition();
if (self.type == BlockType.) {
let scaleX = self.node.scaleX;
@ -891,6 +928,7 @@ export default class Block extends cc.Component {
MapConroler._instance.nextLevel();
this.node.active = false;
this.node.removeFromParent();
console.log("222")
//如果是锤子状态消除
MapConroler._instance.ishammer = false;
MapConroler._instance.ismagic = false;
@ -898,7 +936,12 @@ export default class Block extends cc.Component {
}, tim);
}
stopTimeCutDown() {
if (this.scheduleCallback) {
this.unschedule(this.scheduleCallback);
this.scheduleCallback = null;
}
}
setVibrate(type, count) {
// return;
// console.log("最新:",cc.fx.GameConfig.GM_INFO.vibrateOpen,type);

View File

@ -71,7 +71,8 @@ export default class MapConroler extends cc.Component {
hammerNode: cc.Node = null;
@property(cc.Node)
magicNode: cc.Node = null;
@property(cc.Node)
icetimeNode: cc.Node[] = [];
@property(cc.Node)
magicMask: cc.Node = null;
@ -131,6 +132,7 @@ export default class MapConroler extends cc.Component {
leftDoors: any;
powerState: boolean = false; //
SceneManager: any;
lastMagicTime: number;
// mapInfo: number[][] = [];
@ -1886,6 +1888,7 @@ export default class MapConroler extends cc.Component {
stopTimeCutDown() {
if (this.scheduleCallback) {
this.unschedule(this.scheduleCallback);
this.scheduleCallback = null;
}
}
@ -1920,6 +1923,9 @@ export default class MapConroler extends cc.Component {
this.node.parent.getChildByName("Ice").active = true;
// this.node.parent.getChildByName("Top").getChildByName("Ice").active = true;
this.icetimeNode[0].active = false;
this.icetimeNode[1].active = true;
cc.fx.GameConfig.GM_INFO.freezeAmount -= 1;
if (cc.fx.GameConfig.GM_INFO.freezeAmount < 0)
cc.fx.GameConfig.GM_INFO.freezeAmount = 0;
@ -1953,6 +1959,8 @@ export default class MapConroler extends cc.Component {
freezeBtn.getComponent("btnControl").setTouch(true);
this.node.parent.getChildByName("Ice").active = false;
// this.node.parent.getChildByName("Top").getChildByName("Ice").active = false;
this.icetimeNode[0].active = true;
this.icetimeNode[1].active = false;
this.pause = false;
this.startBoom();
// this.startTimeCutDown();
@ -2136,6 +2144,11 @@ export default class MapConroler extends cc.Component {
//使用魔法棒随机消除两个方块
useMagic() {
//一秒之内只能点一次
if (this.lastMagicTime && Date.now() - this.lastMagicTime < 1200) {
return;
}
this.lastMagicTime = Date.now();
if (this.node.parent.getChildByName("Ice").active == true || this.hammer == true
|| this.magicMask.active == true || this.timeNumber <= 1 || this.gameOver || this.gameWin) {
return;
@ -2418,28 +2431,59 @@ export default class MapConroler extends cc.Component {
// 转换为 cc.v3 数组
const pts = path.map(point => cc.v3(point.x, point.y, point.z));
const totalDur = 0.9; // 总时长
const totalDur = 0.8; // 总时长
const smoothPts = this.getSmoothPath(pts, 10); // 40像素圆滑半径可调整
const smoothPts = this.getSmoothPath(pts, 10); //
this.magics.setPosition(smoothPts[0]);
// this.magics.setPosition(smoothPts[0]);
let totalLen = 0;
let lens: number[] = [];
// 1. 先把节点/粒子立即隐藏并复位
this.magics.stopAllActions(); // 立即停止旧动画
this.magics.setPosition(smoothPts[0]); // 必须在一开始就先放到起点
this.magics.active = true; // 保证节点可见
this.magics.children[0].children[2].active = false; // 先关粒子
this.magics.children[0].children[3].active = false;
for (let i = 1; i < smoothPts.length; i++) {
const len = smoothPts[i].sub(smoothPts[i - 1]).mag();
lens.push(len);
totalLen += len;
}
// 1. 立即停止并清零粒子
const p1 = this.magics.children[0].children[2].getComponent(cc.ParticleSystem);
const p2 = this.magics.children[0].children[3].getComponent(cc.ParticleSystem);
p1 && p1.stopSystem(); // true 表示立即清零
p2 && p2.stopSystem();
// 2. 把节点放到起点
this.magics.stopAllActions();
this.magics.setPosition(smoothPts[0]);
// 3. 下一帧再重新播放
this.scheduleOnce(() => {
p1 && p1.resetSystem(); // 重置到初始状态再播放
p2 && p2.resetSystem();
this.magics.children[0].children[2].active = true;
this.magics.children[0].children[3].active = true;
// 4. tween 动画
let t = cc.tween(this.magics);
for (let i = 1; i < smoothPts.length; i++) {
const segDur = totalDur * (lens[i - 1] / totalLen);
t = t.to(segDur, { position: smoothPts[i] });
}
t.
delay(0.5).call(() => { this.magics.active = false; }) // 播完隐藏
.start();
t.delay(0.5).call(() => {
this.magics.setPosition(-900, -700, 0);
p1 && p1.stopSystem(); // 结束后再停
p2 && p2.stopSystem();
this.magics.children[0].children[2].active = false;
this.magics.children[0].children[3].active = false;
this.magics.active = false;
}).start();
}, 0);
cc.fx.GameConfig.GM_INFO.magicAmount -= 1;
@ -2555,6 +2599,8 @@ export default class MapConroler extends cc.Component {
}
}
//按下暂停按钮
usePause() {
if (this.pause) {
@ -2711,20 +2757,25 @@ export default class MapConroler extends cc.Component {
smoothPts.push(pts[pts.length - 1]);
return smoothPts;
}
startHammer(pos: cc.Vec3) {
this.hammerAni.active = true;
this.hammerAni.scale = 0.5;
this.hammerAni.position = cc.v3(-116, -800);
this.hammerAni.setPosition(this.hammerAni.position);
// this.hammerAni.scale = 0.5;
// this.hammerAni.position = cc.v3(-116, -800);
this.hammerAni.setPosition(pos);
this.hammerAni.zIndex = 1000;
cc.tween(this.hammerAni)
.to(0.9, { position: pos, scale: 1.2 })
.call(() => {
this.hammerAni.getComponent(sp.Skeleton).setAnimation(0, "animation", false);
//播放结束后消失
this.hammerAni.getComponent(sp.Skeleton).setCompleteListener(() => {
this.hammerAni.active = false;
this.hammerAni.scale = 0.5;
})
.start();
// cc.tween(this.hammerAni)
// .to(0.9, { position: pos, scale: 1.2 })
// .call(() => {
// this.hammerAni.active = false;
// this.hammerAni.scale = 0.5;
// })
// .start();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

View File

@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "0f140cc0-8fcb-45c0-8121-be30583d6ea7",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 382,
"height": 125,
"platformSettings": {},
"subMetas": {
"icetime": {
"ver": "1.0.6",
"uuid": "a603aa09-c19d-4f94-9324-1f6a333a9e1a",
"importer": "sprite-frame",
"rawTextureUuid": "0f140cc0-8fcb-45c0-8121-be30583d6ea7",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 382,
"height": 125,
"rawWidth": 382,
"rawHeight": 125,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,9 @@
{
"ver": "1.3.2",
"uuid": "625b0784-d5f1-4e52-9258-6ffa083fd973",
"importer": "prefab",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.3",
"uuid": "5d6b428c-f644-41df-b3c7-2e63b9609538",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}

View File

@ -0,0 +1,109 @@
chuiziyanwu.png
size: 932,936
format: RGBA8888
filter: Linear,Linear
repeat: none
xulie/09
rotate: true
xy: 476, 476
size: 457, 451
orig: 474, 467
offset: 9, 8
index: -1
xulie/10
rotate: true
xy: 473, 0
size: 463, 458
orig: 474, 467
offset: 6, 5
index: -1
xulie/11
rotate: false
xy: 0, 0
size: 471, 464
orig: 474, 467
offset: 2, 2
index: -1
xulie/12
rotate: false
xy: 0, 466
size: 474, 467
orig: 474, 467
offset: 0, 0
index: -1
chuiziyanwu2.png
size: 980,832
format: RGBA8888
filter: Linear,Linear
repeat: none
xulie/01
rotate: false
xy: 854, 171
size: 98, 96
orig: 474, 467
offset: 167, 171
index: -1
xulie/05
rotate: true
xy: 0, 1
size: 387, 397
orig: 474, 467
offset: 44, 37
index: -1
xulie/06
rotate: true
xy: 445, 0
size: 398, 406
orig: 474, 467
offset: 37, 32
index: -1
xulie/07
rotate: false
xy: 446, 400
size: 424, 432
orig: 474, 467
offset: 26, 17
index: -1
xulie/08
rotate: false
xy: 0, 390
size: 444, 442
orig: 474, 467
offset: 16, 11
index: -1
锤子
rotate: false
xy: 854, 269
size: 123, 129
orig: 150, 150
offset: 14, 11
index: -1
chuiziyanwu3.png
size: 364,1004
format: RGBA8888
filter: Linear,Linear
repeat: none
xulie/02
rotate: true
xy: 0, 0
size: 297, 311
orig: 474, 467
offset: 92, 73
index: -1
xulie/03
rotate: true
xy: 0, 299
size: 330, 339
orig: 474, 467
offset: 74, 64
index: -1
xulie/04
rotate: false
xy: 0, 631
size: 364, 372
orig: 474, 467
offset: 57, 49
index: -1

View File

@ -0,0 +1,6 @@
{
"ver": "1.0.3",
"uuid": "b2d4c147-42f8-40ce-b634-96ef881ccf60",
"importer": "asset",
"subMetas": {}
}

View File

@ -0,0 +1 @@
{"skeleton":{"hash":"N5M3TikO6y39mfdROd1Vzv7jvr8","spine":"3.8.99","x":-176.53,"y":-196.29,"width":430.62,"height":373.6,"images":"","audio":""},"bones":[{"name":"root"},{"name":"chuizi","parent":"root","length":66.34,"rotation":129.94,"x":194.2,"y":-14.2},{"name":"yan","parent":"root","x":13.07,"y":-9.99}],"slots":[{"name":"微信图片_20250515154600","bone":"root"},{"name":"xulie/01","bone":"yan","attachment":"xulie/01"},{"name":"锤子","bone":"chuizi","attachment":"锤子"}],"skins":[{"name":"default","attachments":{"xulie/01":{"xulie/01":{"y":0.5,"scaleX":0.8,"scaleY":0.8,"width":474,"height":467},"xulie/02":{"y":0.5,"width":474,"height":467},"xulie/03":{"y":0.5,"width":474,"height":467},"xulie/04":{"y":0.5,"width":474,"height":467},"xulie/05":{"y":0.5,"width":474,"height":467},"xulie/06":{"y":0.5,"width":474,"height":467},"xulie/07":{"y":0.5,"width":474,"height":467},"xulie/08":{"y":0.5,"width":474,"height":467},"xulie/09":{"y":0.5,"width":474,"height":467},"xulie/10":{"y":0.5,"width":474,"height":467},"xulie/11":{"y":0.5,"width":474,"height":467},"xulie/12":{"y":0.5,"width":474,"height":467}},"锤子":{"锤子":{"x":18.03,"y":4.61,"rotation":-129.94,"width":150,"height":150}}}}],"animations":{"animation":{"slots":{"xulie/01":{"color":[{"color":"ffffff00"},{"time":0.4667,"color":"ffffff00"},{"time":0.5,"color":"ffffffff","curve":"stepped"},{"time":1.1,"color":"ffffffff"},{"time":1.4,"color":"ffffff00"}],"attachment":[{"time":0.5667,"name":"xulie/02"},{"time":0.6333,"name":"xulie/03"},{"time":0.7,"name":"xulie/04"},{"time":0.7667,"name":"xulie/05"},{"time":0.8333,"name":"xulie/06"},{"time":0.9,"name":"xulie/07"},{"time":0.9667,"name":"xulie/08"},{"time":1.0333,"name":"xulie/09"},{"time":1.1,"name":"xulie/10"},{"time":1.1667,"name":"xulie/11"},{"time":1.2333,"name":"xulie/12"}]}},"bones":{"yan":{"scale":[{"time":1.1},{"time":1.4667,"x":1.2,"y":1.2}]},"chuizi":{"rotate":[{},{"time":0.2,"angle":-37.24},{"time":0.3667,"angle":-91.22},{"time":0.4667,"angle":87.84},{"time":0.5333,"angle":75.55},{"time":0.6,"angle":87.84},{"time":0.6667,"angle":72.94},{"time":0.7333,"angle":81.23}],"translate":[{"x":116.08,"y":13.66},{"time":0.1667,"x":-47.18,"y":91.66},{"time":0.3667,"x":-163.87,"y":61.45}]}}}}}

View File

@ -0,0 +1,12 @@
{
"ver": "1.2.5",
"uuid": "17d057a5-61c2-4d91-b0ba-aac2bc0bd485",
"importer": "spine",
"textures": [
"f678cc9b-1bcf-4055-ae2a-93cb1e2bcd1e",
"14bff8d8-afe6-4610-965f-400d5cab7944",
"3b0ef6ea-3527-4a08-95c7-8851064c54e2"
],
"scale": 1,
"subMetas": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

View File

@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "f678cc9b-1bcf-4055-ae2a-93cb1e2bcd1e",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 932,
"height": 936,
"platformSettings": {},
"subMetas": {
"chuiziyanwu": {
"ver": "1.0.6",
"uuid": "e7ae2a01-0e46-42f7-9a7f-0559ea0ad2e9",
"importer": "sprite-frame",
"rawTextureUuid": "f678cc9b-1bcf-4055-ae2a-93cb1e2bcd1e",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -0.5,
"offsetY": 1.5,
"trimX": 0,
"trimY": 0,
"width": 931,
"height": 933,
"rawWidth": 932,
"rawHeight": 936,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

View File

@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "14bff8d8-afe6-4610-965f-400d5cab7944",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 980,
"height": 832,
"platformSettings": {},
"subMetas": {
"chuiziyanwu2": {
"ver": "1.0.6",
"uuid": "c86e27f1-a907-41c6-bf70-8591f9cd0cf1",
"importer": "sprite-frame",
"rawTextureUuid": "14bff8d8-afe6-4610-965f-400d5cab7944",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -1.5,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 977,
"height": 832,
"rawWidth": 980,
"rawHeight": 832,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

View File

@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "3b0ef6ea-3527-4a08-95c7-8851064c54e2",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 364,
"height": 1004,
"platformSettings": {},
"subMetas": {
"chuiziyanwu3": {
"ver": "1.0.6",
"uuid": "ae854200-91b5-4e7f-8c7d-08da08b40431",
"importer": "sprite-frame",
"rawTextureUuid": "3b0ef6ea-3527-4a08-95c7-8851064c54e2",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0.5,
"trimX": 0,
"trimY": 0,
"width": 364,
"height": 1003,
"rawWidth": 364,
"rawHeight": 1004,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}