更新音频

This commit is contained in:
COMPUTER\EDY 2025-10-21 10:49:18 +08:00
parent b0ed21d091
commit dfaa650809
27 changed files with 189 additions and 9 deletions

View File

@ -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"
},
{

View File

@ -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;

View File

@ -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;
}
}
}

View File

@ -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) {

View File

@ -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

View File

@ -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;

View File

@ -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();

View File

@ -8,8 +8,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 383,
"height": 129,
"width": 464,
"height": 212,
"platformSettings": {},
"subMetas": {
"top": {

BIN
assets/music/adhesive.mp3 Normal file

Binary file not shown.

Binary file not shown.

BIN
assets/music/freezeDoor.mp3 Normal file

Binary file not shown.

BIN
assets/music/hammer.mp3 Normal file

Binary file not shown.

BIN
assets/music/hit1.mp3 Normal file

Binary file not shown.

BIN
assets/music/hit2.mp3 Normal file

Binary file not shown.

BIN
assets/music/hit3.mp3 Normal file

Binary file not shown.

BIN
assets/music/hit4.mp3 Normal file

Binary file not shown.

BIN
assets/music/hit5.mp3 Normal file

Binary file not shown.

BIN
assets/music/lockBlock1.mp3 Normal file

Binary file not shown.

BIN
assets/music/lockBlock2.mp3 Normal file

Binary file not shown.

BIN
assets/music/lockDoor.mp3 Normal file

Binary file not shown.

BIN
assets/music/magic1.mp3 Normal file

Binary file not shown.

BIN
assets/music/magic2.mp3 Normal file

Binary file not shown.

Binary file not shown.

BIN
assets/music/stacking.mp3 Normal file

Binary file not shown.

BIN
assets/music/starBlock.mp3 Normal file

Binary file not shown.

BIN
assets/music/timePause1.mp3 Normal file

Binary file not shown.

BIN
assets/music/timePause2.mp3 Normal file

Binary file not shown.