Commit f8ba5ef3 authored by Tt's avatar Tt

音效添加完成

parent afee7527
{
"ver": "2.0.1",
"uuid": "67e3f84a-468b-45cd-b563-afcfddc80aee",
"downloadMode": 0,
"duration": 48.039184,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "fb1b00f8-5a5f-4e14-8b4f-74086255de51",
"downloadMode": 0,
"duration": 1.28,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "1a0d674e-d9e2-43d5-bd71-baf85e7630fe",
"downloadMode": 0,
"duration": 0.219333,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
...@@ -123,6 +123,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -123,6 +123,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
private voiceTouchForbid: boolean; private voiceTouchForbid: boolean;
private count: number; private count: number;
initGame() { initGame() {
cc.audioEngine.playMusic(this.bgmNode.getComponent(cc.AudioSource).clip, true);
this.count = 0; this.count = 0;
this.touchForbid = true; this.touchForbid = true;
this.voiceTouchForbid = true; this.voiceTouchForbid = true;
...@@ -489,7 +490,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -489,7 +490,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
let posArray = posList[data.options.length]; let posArray = posList[data.options.length];
let posY = this.card_pos.y; let posY = this.card_pos.y;
// 计算Y的值 // 计算Y的值
// let img = pg.view.find(layer, 'title/img') // let img = pg.view.find(layer, 'title/img')
// pg.view.setNetImg(img, data.image, { w: 660, h: 320 }) // pg.view.setNetImg(img, data.image, { w: 660, h: 320 })
...@@ -537,6 +538,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -537,6 +538,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
private btn_start: cc.Node = null; private btn_start: cc.Node = null;
onTouchStart(e) { onTouchStart(e) {
if (this.touchForbid) return;// 顶级禁止全部点击 if (this.touchForbid) return;// 顶级禁止全部点击
this.playLocalAudio("touch")
cc.Tween.stopAllByTarget(this.btn_start) cc.Tween.stopAllByTarget(this.btn_start)
this.btn_start.scale = 1; this.btn_start.scale = 1;
this.touchForbid = true; this.touchForbid = true;
...@@ -563,6 +565,8 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -563,6 +565,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.currentDt = data; this.currentDt = data;
this.touchForbid = true; this.touchForbid = true;
this.playLocalAudio("move")
cc.tween(this.gou_node) cc.tween(this.gou_node)
// 移动钩子 // 移动钩子
.to(0.5, { x: item.x }) .to(0.5, { x: item.x })
...@@ -606,9 +610,10 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -606,9 +610,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
private btn_close: cc.Node = null; private btn_close: cc.Node = null;
showRecord(item) { showRecord(item) {
let startPos = cc.v2(item); let startPos = cc.v2(item);
cc.tween(item).to(0.3, { y: startPos.y + 50 }).call(() => { cc.tween(item).to(0.3, { y: startPos.y + 50 }).call(() => {
this.playBgmP10();
item.active = false; item.active = false;
item.y = startPos.y; item.y = startPos.y;
...@@ -680,6 +685,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -680,6 +685,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
clearTimeout(this.btn_voice_time_id) clearTimeout(this.btn_voice_time_id)
this.btn_voice_time_id = null; this.btn_voice_time_id = null;
} }
this.pauseBgm();
// 录音 // 录音
let btn_voice = e.target; let btn_voice = e.target;
let normal = pg.view.find(btn_voice, 'normal') let normal = pg.view.find(btn_voice, 'normal')
...@@ -700,6 +706,8 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -700,6 +706,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
let score = recordData.result.overall let score = recordData.result.overall
this.updatePopAni(null, score); this.updatePopAni(null, score);
this.checkCardsTime = 3; this.checkCardsTime = 3;
this.resumeBgm();
this.playBgmP100();
}) })
} else { } else {
this.recording = true; this.recording = true;
...@@ -911,6 +919,50 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -911,6 +919,50 @@ export default class SceneComponent extends MyCocosSceneComponent {
}); });
}) })
} }
@property(cc.Node)
bgmNode: cc.Node = null;
playBgmP10() {
this.scheduleOnce(() => {
cc.audioEngine.setMusicVolume(0.8);
this.scheduleOnce(() => {
cc.audioEngine.setMusicVolume(0.6);
this.scheduleOnce(() => {
cc.audioEngine.setMusicVolume(0.4);
this.scheduleOnce(() => {
cc.audioEngine.setMusicVolume(0.2);
this.scheduleOnce(() => {
cc.audioEngine.setMusicVolume(0.1);
}, 0.4)
}, 0.4)
}, 0.4)
}, 0.4)
}, 0.4)
}
pauseBgm() {
cc.audioEngine.pauseMusic();
}
resumeBgm() {
cc.audioEngine.resumeMusic();
}
playBgmP100() {
this.scheduleOnce(() => {
cc.audioEngine.setMusicVolume(0.2);
this.scheduleOnce(() => {
cc.audioEngine.setMusicVolume(0.4);
this.scheduleOnce(() => {
cc.audioEngine.setMusicVolume(0.6);
this.scheduleOnce(() => {
cc.audioEngine.setMusicVolume(0.8);
this.scheduleOnce(() => {
cc.audioEngine.setMusicVolume(1);
}, 0.4)
}, 0.4)
}, 0.4)
}, 0.4)
}, 0.4)
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment