diff --git a/assets/Scene/HomeScene.fire b/assets/Scene/HomeScene.fire index 5b0898c..c2d17a8 100644 --- a/assets/Scene/HomeScene.fire +++ b/assets/Scene/HomeScene.fire @@ -172,6 +172,63 @@ "zhuan2": { "__uuid__": "998a24bd-ffa0-4f96-bc39-a9789f42bd9b" }, + "adhesive": { + "__uuid__": "e0f2c22c-d8dd-4dad-9fa2-7b73d15a5518" + }, + "freezeBlock": { + "__uuid__": "9a056601-12c6-45dd-abde-a847d6f15247" + }, + "freezeDoor": { + "__uuid__": "20367986-5fa0-4558-9c73-861dc7bc1293" + }, + "hammer": { + "__uuid__": "a25b43cf-deba-4061-a5da-e87aa343269d" + }, + "lockBlock1": { + "__uuid__": "227cb730-4de8-41e2-93d1-f9e8cfdffd11" + }, + "lockBlock2": { + "__uuid__": "2cfcd2ad-bb5d-47c0-be0a-3a8135d89c1f" + }, + "lockDoor": { + "__uuid__": "25ca59d5-b522-472d-83e4-de16fd1cdd5c" + }, + "magic1": { + "__uuid__": "b8ec297a-cc2d-4a82-ac2c-345db075ce84" + }, + "magic2": { + "__uuid__": "e09b4699-ba82-4ac8-9894-d8b88640d041" + }, + "simpleColor": { + "__uuid__": "6f213771-d0ef-45ba-b87d-e878f291886b" + }, + "stacking": { + "__uuid__": "2c418573-4beb-49f8-bafe-6a9ae7906195" + }, + "starBlock": { + "__uuid__": "643d1ba5-fd6f-45ab-928e-c271afddbcef" + }, + "timePause1": { + "__uuid__": "f5c8c01d-aa75-4518-a7c6-82599ad31e58" + }, + "timePause2": { + "__uuid__": "37c7f2a9-e0d2-4f3e-9ed6-1ad2ef1862c0" + }, + "hit1": { + "__uuid__": "e16fd77e-9bbb-4bd1-b149-e1dd5a409c8f" + }, + "hit2": { + "__uuid__": "bab2f84c-f988-4355-8fc7-2c55a09cc089" + }, + "hit3": { + "__uuid__": "e06aa433-8f1d-4787-8e6d-7fe6a29ca6f5" + }, + "hit4": { + "__uuid__": "ed4cf450-ae51-46ce-997a-50dd75d9a519" + }, + "hit5": { + "__uuid__": "b27d353c-e4fe-46de-b7c9-75d2b96363d3" + }, "_id": "24lN1LYRdNia3ZOiLsINIp" }, { diff --git a/assets/Script/Block.ts b/assets/Script/Block.ts index a297cea..f23b460 100644 --- a/assets/Script/Block.ts +++ b/assets/Script/Block.ts @@ -440,6 +440,7 @@ export default class Block extends cc.Component { removeAdhesive(action) { if (this.adhesiveNode.length > 0) { + cc.fx.AudioManager._instance.playEffect("adhesive", null); for (let i = 0; i < this.adhesiveNode.length; i++) { let adhesive = this.adhesiveNode[i]; // if (action == true) @@ -547,6 +548,7 @@ export default class Block extends cc.Component { let self = this; let pos = this.node.getPosition(); if (this.type == BlockType.叠加块下) { + cc.fx.AudioManager._instance.playEffect("stacking", null); let scaleX = this.node.scaleX; let scaleY = this.node.scaleY; this.block_Info.node.getComponent("Block").restoreNomal(this.posX, this.posY, true); @@ -561,10 +563,15 @@ export default class Block extends cc.Component { this.block_Info.node.getComponent("Block").posY, false); this.block_Info.node = null; } + else if (this.type == BlockType.星星块) { + cc.fx.AudioManager._instance.playEffect("starBlock", null); + } else if (this.type == BlockType.炸弹块) { this.node.getChildByName("boom").getComponent("Boom").destroyBoom(false); } - + else if (this.type == BlockType.钥匙块) { + cc.fx.AudioManager._instance.playEffect("lockBlock2", null); + } let time = 0.33; // this.node.zIndex = 0; @@ -574,7 +581,8 @@ export default class Block extends cc.Component { setTimeout(() => { cc.fx.AudioManager._instance.playEffect("xiaochu", null); - }, 300); + MapConroler._instance.playHitSound(); + }, 0); this.setVibrate("light", 3) if (diraction == 0) { @@ -682,7 +690,10 @@ export default class Block extends cc.Component { } if (this.type != BlockType.上锁块 && this.type != BlockType.冻结块) { MapConroler._instance.startUpdate(); - cc.fx.AudioManager._instance.playEffect("hit", null); + if (this.type == BlockType.钥匙块) + cc.fx.AudioManager._instance.playEffect("lockBlock1", null); + else + cc.fx.AudioManager._instance.playEffect("hit", null); this.node.zIndex = 200; if (this.type == 9) { if (this.block_Info.node) { @@ -847,6 +858,7 @@ export default class Block extends cc.Component { MapConroler._instance.judgeWin(1); let pos = this.node.getPosition(); if (self.type == BlockType.叠加块下) { + cc.fx.AudioManager._instance.playEffect("stacking", null); let scaleX = self.node.scaleX; let scaleY = self.node.scaleY; self.block_Info.node.getComponent("Block").restoreNomal(this.posX, this.posY, true); @@ -857,6 +869,12 @@ export default class Block extends cc.Component { else if (self.type == BlockType.炸弹块) { this.node.getChildByName("boom").getComponent("Boom").destroyBoom(false); } + else if (this.type == BlockType.星星块) { + cc.fx.AudioManager._instance.playEffect("starBlock", null); + } + else if (this.type == BlockType.钥匙块) { + cc.fx.AudioManager._instance.playEffect("lockBlock2", null); + } MapConroler._instance.nextLevel(0); this.node.active = false; @@ -889,7 +907,9 @@ export default class Block extends cc.Component { MapConroler._instance.pause = true; if (MapConroler._instance.ishammer == true) { let parentSize = this.node.getContentSize(); - + setTimeout(() => { + cc.fx.AudioManager._instance.playEffect("hammer", null); + }, 300); let pos = cc.v3(0, 0, 0) if (this.node.anchorX == 1) { pos = cc.v3(this.node.position.x - parentSize.width / 2, @@ -982,6 +1002,7 @@ export default class Block extends cc.Component { MapConroler._instance.judgeWin(0); let pos = this.node.getPosition(); if (self.type == BlockType.叠加块下) { + cc.fx.AudioManager._instance.playEffect("stacking", null); let scaleX = self.node.scaleX; let scaleY = self.node.scaleY; self.block_Info.node.getComponent("Block").restoreNomal(this.posX, this.posY, true); @@ -992,6 +1013,12 @@ export default class Block extends cc.Component { else if (self.type == BlockType.炸弹块) { this.node.getChildByName("boom").getComponent("Boom").destroyBoom(false); } + else if (this.type == BlockType.星星块) { + cc.fx.AudioManager._instance.playEffect("starBlock", null); + } + else if (this.type == BlockType.钥匙块) { + cc.fx.AudioManager._instance.playEffect("lockBlock2", null); + } MapConroler._instance.nextLevel(0); this.node.active = false; diff --git a/assets/Script/Map.ts b/assets/Script/Map.ts index 7f3ac33..71e3561 100644 --- a/assets/Script/Map.ts +++ b/assets/Script/Map.ts @@ -152,6 +152,8 @@ export default class MapConroler extends cc.Component { revolving_state: number = 0;//是否是旋转门关卡,0:不是,1:顺时针旋转,2:逆时针旋转 revolvingWallArray: any; //旋转门数组 isTimeRewive: boolean = false; // 是否使用时间复活过 + hitSoundCount: number; + hitSoundTime: number; // mapInfo: number[][] = []; @@ -1499,6 +1501,7 @@ export default class MapConroler extends cc.Component { changeState(type) { if (type) { if (this.openWall.length != 0) { + cc.fx.AudioManager._instance.playEffect("lockDoor", null); for (let i = 0; i < this.openWall.length; i++) { this.openWall[i].getChildByName("wall").getComponent("Wall").changeLock(); } @@ -2504,6 +2507,7 @@ export default class MapConroler extends cc.Component { } } } + cc.fx.AudioManager._instance.playEffect("timePause1", null); const timestamp = Date.now(); this.freezeMask.active = true; this.stopBoom(); @@ -2552,6 +2556,15 @@ export default class MapConroler extends cc.Component { //解开时间冻结 openIce() { if (this.node.parent.getChildByName("Ice").active) { + cc.fx.AudioManager._instance.playEffect("timePause2", null); + setTimeout(() => { + if (!this.node.parent.getChildByName("Ice").active) + cc.fx.AudioManager._instance.playEffect("timePause2", null); + }, 1000); + setTimeout(() => { + if (!this.node.parent.getChildByName("Ice").active) + cc.fx.AudioManager._instance.playEffect("timePause2", null); + }, 2000); this.freezeMask.active = true; /// false // cc.fx.GameTool.setGray(this.timeBtn.node, true); this.timeBtn.node.getChildByName("mul10").opacity = 0; @@ -3184,7 +3197,10 @@ export default class MapConroler extends cc.Component { .start(); }, 0); - + cc.fx.AudioManager._instance.playEffect("magic1", null); + setTimeout(() => { + cc.fx.AudioManager._instance.playEffect("magic2", null); + }, 1200); cc.fx.GameConfig.GM_INFO.magicAmount -= 1; if (cc.fx.GameConfig.GM_INFO.magicAmount < 0) @@ -3889,7 +3905,20 @@ export default class MapConroler extends cc.Component { } - update(dt) { + //连击播放声音 + playHitSound() { + this.hitSoundCount++; + if (this.hitSoundCount > 5) { + this.hitSoundCount = 1; + } + cc.fx.AudioManager._instance.playEffect("hit" + (this.hitSoundCount), null); + this.hitSoundTime = Date.now(); // 记录当前播放时间 + } + update(dt) { + // 检测连击超时,如果超过3秒没有播放音效,重置连击计数 + if (this.hitSoundCount > 0 && this.hitSoundTime && Date.now() - this.hitSoundTime > 3000) { + this.hitSoundCount = 0; + } } } diff --git a/assets/Script/Wall.ts b/assets/Script/Wall.ts index ad17960..4a17245 100644 --- a/assets/Script/Wall.ts +++ b/assets/Script/Wall.ts @@ -378,6 +378,7 @@ export default class Wall extends cc.Component { resetFreeze() { this.special = 0; if (this.freezeNode) { + cc.fx.AudioManager._instance.playEffect("freezeDoor", null); this.freezeNode.active = false; } // if (this.wall_Info.length != 0) { diff --git a/assets/Script/lq_collide_system/lq_collide.ts b/assets/Script/lq_collide_system/lq_collide.ts index 8ef2231..3a6f0a0 100644 --- a/assets/Script/lq_collide_system/lq_collide.ts +++ b/assets/Script/lq_collide_system/lq_collide.ts @@ -361,6 +361,32 @@ export class LQCollide extends Component { // if (LQCollideConfig.switch_print_log) { // console.log(this.node.name + ' on_enter'); // } + let block = this.node.parent.getComponent("Block"); + + if (collide.node.name == "rise" && block.type == 9) { + let otherColor = collide.node.parent.getChildByName("risefall").getChildByName("color").getComponent(cc.Label).string; + if (block.color == otherColor && this.data_string != "-1") { + return; + } + if (block.block_Info.node.getComponent("Block").color == otherColor && this.data_string == "-1") { + return; + } + // if (this.is_music == false) { + // this.is_music = true; + cc.fx.AudioManager._instance.playEffect("simpleColor", null); + // } + + } + else if (collide.node.name == "rise" && block.type != 9) { + let otherColor = collide.node.parent.getChildByName("risefall").getChildByName("color").getComponent(cc.Label).string; + if (block.color == otherColor) { + return; + } + // if (this.is_music == false) { + // this.is_music = true; + cc.fx.AudioManager._instance.playEffect("simpleColor", null); + // } + } } //@ts-ignore diff --git a/assets/Script/module/Music/AudioManager.ts b/assets/Script/module/Music/AudioManager.ts index ce77b6f..e6c6f99 100644 --- a/assets/Script/module/Music/AudioManager.ts +++ b/assets/Script/module/Music/AudioManager.ts @@ -33,6 +33,46 @@ export default class AudioManager extends cc.Component { @property(cc.AudioClip) zhuan2: cc.AudioClip = null; + + @property(cc.AudioClip) + adhesive: cc.AudioClip = null; + @property(cc.AudioClip) + freezeBlock: cc.AudioClip = null; + @property(cc.AudioClip) + freezeDoor: cc.AudioClip = null; + @property(cc.AudioClip) + hammer: cc.AudioClip = null; + @property(cc.AudioClip) + lockBlock1: cc.AudioClip = null; + @property(cc.AudioClip) + lockBlock2: cc.AudioClip = null; + @property(cc.AudioClip) + lockDoor: cc.AudioClip = null; + @property(cc.AudioClip) + magic1: cc.AudioClip = null; + @property(cc.AudioClip) + magic2: cc.AudioClip = null; + @property(cc.AudioClip) + simpleColor: cc.AudioClip = null; + @property(cc.AudioClip) + stacking: cc.AudioClip = null; + @property(cc.AudioClip) + starBlock: cc.AudioClip = null; + @property(cc.AudioClip) + timePause1: cc.AudioClip = null; + @property(cc.AudioClip) + timePause2: cc.AudioClip = null; + @property(cc.AudioClip) + hit1: cc.AudioClip = null; + @property(cc.AudioClip) + hit2: cc.AudioClip = null; + @property(cc.AudioClip) + hit3: cc.AudioClip = null; + @property(cc.AudioClip) + hit4: cc.AudioClip = null; + @property(cc.AudioClip) + hit5: cc.AudioClip = null; + mAudioMap: {}; bgMusicVolume: number; effectMusicVolume: number; diff --git a/assets/Script/prop/Freeze.ts b/assets/Script/prop/Freeze.ts index 952ae03..3a7d511 100644 --- a/assets/Script/prop/Freeze.ts +++ b/assets/Script/prop/Freeze.ts @@ -55,7 +55,7 @@ export default class Freeze extends cc.Component { cc.tween(this.node.getChildByName("icon")) .to(0.5, { opacity: 0 }) .start(); - + cc.fx.AudioManager._instance.playEffect("freezeBlock", null); // this.node.getChildByName("icon").getComponent(cc.Sprite).setMaterial(0,this.freeze); // this.node.children.forEach(element => { // element.destroy(); diff --git a/assets/UI/UI/pop/top.png.meta b/assets/UI/UI/pop/top.png.meta index 906cbe4..6d8fe7d 100644 --- a/assets/UI/UI/pop/top.png.meta +++ b/assets/UI/UI/pop/top.png.meta @@ -8,8 +8,8 @@ "premultiplyAlpha": false, "genMipmaps": false, "packable": true, - "width": 383, - "height": 129, + "width": 464, + "height": 212, "platformSettings": {}, "subMetas": { "top": { diff --git a/assets/music/adhesive.mp3 b/assets/music/adhesive.mp3 new file mode 100644 index 0000000..96d8572 Binary files /dev/null and b/assets/music/adhesive.mp3 differ diff --git a/assets/music/freezeBlock.mp3 b/assets/music/freezeBlock.mp3 new file mode 100644 index 0000000..951ce57 Binary files /dev/null and b/assets/music/freezeBlock.mp3 differ diff --git a/assets/music/freezeDoor.mp3 b/assets/music/freezeDoor.mp3 new file mode 100644 index 0000000..d0c53a4 Binary files /dev/null and b/assets/music/freezeDoor.mp3 differ diff --git a/assets/music/hammer.mp3 b/assets/music/hammer.mp3 new file mode 100644 index 0000000..20903fc Binary files /dev/null and b/assets/music/hammer.mp3 differ diff --git a/assets/music/hit1.mp3 b/assets/music/hit1.mp3 new file mode 100644 index 0000000..18ee21f Binary files /dev/null and b/assets/music/hit1.mp3 differ diff --git a/assets/music/hit2.mp3 b/assets/music/hit2.mp3 new file mode 100644 index 0000000..9b8065c Binary files /dev/null and b/assets/music/hit2.mp3 differ diff --git a/assets/music/hit3.mp3 b/assets/music/hit3.mp3 new file mode 100644 index 0000000..38c9630 Binary files /dev/null and b/assets/music/hit3.mp3 differ diff --git a/assets/music/hit4.mp3 b/assets/music/hit4.mp3 new file mode 100644 index 0000000..b408561 Binary files /dev/null and b/assets/music/hit4.mp3 differ diff --git a/assets/music/hit5.mp3 b/assets/music/hit5.mp3 new file mode 100644 index 0000000..93982e9 Binary files /dev/null and b/assets/music/hit5.mp3 differ diff --git a/assets/music/lockBlock1.mp3 b/assets/music/lockBlock1.mp3 new file mode 100644 index 0000000..b5d95ae Binary files /dev/null and b/assets/music/lockBlock1.mp3 differ diff --git a/assets/music/lockBlock2.mp3 b/assets/music/lockBlock2.mp3 new file mode 100644 index 0000000..94465c1 Binary files /dev/null and b/assets/music/lockBlock2.mp3 differ diff --git a/assets/music/lockDoor.mp3 b/assets/music/lockDoor.mp3 new file mode 100644 index 0000000..44904f1 Binary files /dev/null and b/assets/music/lockDoor.mp3 differ diff --git a/assets/music/magic1.mp3 b/assets/music/magic1.mp3 new file mode 100644 index 0000000..3d60b79 Binary files /dev/null and b/assets/music/magic1.mp3 differ diff --git a/assets/music/magic2.mp3 b/assets/music/magic2.mp3 new file mode 100644 index 0000000..61f3fd5 Binary files /dev/null and b/assets/music/magic2.mp3 differ diff --git a/assets/music/simpleColor.mp3 b/assets/music/simpleColor.mp3 new file mode 100644 index 0000000..3cfb1ae Binary files /dev/null and b/assets/music/simpleColor.mp3 differ diff --git a/assets/music/stacking.mp3 b/assets/music/stacking.mp3 new file mode 100644 index 0000000..7823337 Binary files /dev/null and b/assets/music/stacking.mp3 differ diff --git a/assets/music/starBlock.mp3 b/assets/music/starBlock.mp3 new file mode 100644 index 0000000..556bc9b Binary files /dev/null and b/assets/music/starBlock.mp3 differ diff --git a/assets/music/timePause1.mp3 b/assets/music/timePause1.mp3 new file mode 100644 index 0000000..731e168 Binary files /dev/null and b/assets/music/timePause1.mp3 differ diff --git a/assets/music/timePause2.mp3 b/assets/music/timePause2.mp3 new file mode 100644 index 0000000..d135ed9 Binary files /dev/null and b/assets/music/timePause2.mp3 differ