Commit c8d812a4 authored by yu's avatar yu

1

parent cec30702
...@@ -726,11 +726,17 @@ cc.Class({ ...@@ -726,11 +726,17 @@ cc.Class({
}, },
async playCardAudio() { async playCardAudio() {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
let orderAudio = this._stageData.orderAudio; let orderAudio = this._stageData.titleGroup;
for (let i = 0; i < orderAudio.length; i++) { for (let i = 0; i < orderAudio.length; i++) {
await pg.audio.playAudioByUrl(orderAudio[i], (id) => { let t = orderAudio[i];
await pg.audio.playAudioByUrl(t.audio, (id) => {
let time = cc.audioEngine.getDuration(id); let time = cc.audioEngine.getDuration(id);
this.showCardAction(i, time); for (let j = 0; j < t.index.length; j++) {
if (t.index[j] && t.index[j] == 1) {
console.log("id: " + j + " i:" + i);
this.showCardAction(j, time);
}
}
}) })
} }
let layout_short = cc.find("card_group/layout_short", this.node); let layout_short = cc.find("card_group/layout_short", this.node);
...@@ -749,9 +755,9 @@ cc.Class({ ...@@ -749,9 +755,9 @@ cc.Class({
let layout = this._stageData.word.length <= 5 ? layout_short : layout_long; let layout = this._stageData.word.length <= 5 ? layout_short : layout_long;
let t = time / 2; let t = time / 2;
if (t < 0.1) t += 0.2; if (t < 0.1) t += 0.2;
layout.children.forEach((item) => { layout.children.forEach((item, idx) => {
if (!item.data) return; if (idx != id) return;
if (id != item.data.order) return; // if (id != item.data.order) return;
cc.tween(item).by(t, { y: 20 }).by(t, { y: -20 }).start(); cc.tween(item).by(t, { y: 20 }).by(t, { y: -20 }).start();
}) })
}, },
......
...@@ -34,6 +34,7 @@ class GameManager { ...@@ -34,6 +34,7 @@ class GameManager {
let obj = {}; let obj = {};
obj.word = ar.titleObj; obj.word = ar.titleObj;
obj.sound = ar.wordAudio; obj.sound = ar.wordAudio;
obj.titleGroup = ar.titleGroup;
obj.orderAudio = ar.orderAudio; obj.orderAudio = ar.orderAudio;
obj.img = ar.bgImg; obj.img = ar.bgImg;
obj.cartoonSke = ar.imgAni.ske.url; obj.cartoonSke = ar.imgAni.ske.url;
......
This diff is collapsed.
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