Commit e190ed8a authored by Tt's avatar Tt

1

parent 26d85fed
...@@ -740,11 +740,17 @@ cc.Class({ ...@@ -740,11 +740,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);
...@@ -763,9 +769,8 @@ cc.Class({ ...@@ -763,9 +769,8 @@ 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;
cc.tween(item).by(t, { y: 20 }).by(t, { y: -20 }).start(); cc.tween(item).by(t, { y: 20 }).by(t, { y: -20 }).start();
}) })
}, },
......
...@@ -35,6 +35,7 @@ class GameManager { ...@@ -35,6 +35,7 @@ class GameManager {
obj.word = ar.titleObj; obj.word = ar.titleObj;
obj.sound = ar.wordAudio; obj.sound = ar.wordAudio;
obj.orderAudio = ar.orderAudio; obj.orderAudio = ar.orderAudio;
obj.titleGroup = ar.titleGroup;
obj.img = ar.bgImg; obj.img = ar.bgImg;
obj.cartoonSke = ar.imgAni.ske.url; obj.cartoonSke = ar.imgAni.ske.url;
obj.cartoonTex = ar.imgAni.tex.url; obj.cartoonTex = ar.imgAni.tex.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