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;
......
...@@ -14,283 +14,84 @@ export const defaultData = { ...@@ -14,283 +14,84 @@ export const defaultData = {
}, },
"list": [ "list": [
{ {
"title": "AnUmbrellaAA", "title": "tape",
"titleRed": [ "titleRed": [
null,
1,
null,
1
],
"titleGroupUseWord": [
[
null,
1,
1,
1
],
[
1, 1,
null, null,
1
],
[
1,
1, 1,
null, null,
1 1
],
[
1,
1,
1,
1
]
], ],
"titleGroupUseWord": [ "titleGroup": [
[ {
null, "index": [
1, 1
1,
1,
1,
1,
1,
1
],
[
1,
0,
1,
1,
1,
1,
1,
1
],
[
1,
1,
null,
1,
1,
1,
1,
1
],
[
1,
1,
1,
null,
1,
1,
1,
1
],
[
1,
1,
1,
1,
null,
1,
1,
1
],
[
1,
1,
1,
1,
1,
null,
1,
1
],
[
1,
1,
1,
1,
1,
1,
null,
1
],
[
1,
1,
1,
1,
1,
1,
1
],
[
1,
1,
1,
1,
1,
1,
1,
1
], ],
[ "audio": "http://staging-teach.cdn.ireadabc.com/f6872d4060663e733c9774929b2eeb21.mp3"
1, },
1, {
1, "index": [
1, null,
1, 1,
1, null,
1, 1
1
], ],
[ "audio": "http://staging-teach.cdn.ireadabc.com/5f5d6834729bb822158a4c9a70cc955d.mp3"
1, },
1, {
1, "index": [
1, null,
1, null,
1, 1
1,
1
], ],
[ "audio": "http://staging-teach.cdn.ireadabc.com/0913981cdeb2c6bc785de1054e80a500.mp3"
1, }
1,
1,
1,
1,
1,
1,
1
]
],
"titleGroup": [
{
"index": [
1,
0
],
"audio": "https://staging-teach.cdn.ireadabc.com/f0578961665dbdb83c61e0be64711d23.mp3"
},
{
"index": [
null,
1
],
"audio": "https://staging-teach.cdn.ireadabc.com/c19a36db84b60ad5dc30df8b32d5dd96.mp3"
},
{
"index": [
null,
null,
1
],
"audio": "https://staging-teach.cdn.ireadabc.com/b0d4670315235e5b94ff40de00b6779e.mp3"
},
{
"index": [
null,
null,
null,
1
],
"audio": "https://staging-teach.cdn.ireadabc.com/a335249581878901140a9ea0395a7201.mp3"
},
{
"index": [
null,
null,
null,
null,
1
],
"audio": "https://staging-teach.cdn.ireadabc.com/e110cc72cee01e543c69ceb2e94f086e.mp3"
},
{
"index": [
null,
null,
null,
null,
null,
1
],
"audio": "https://staging-teach.cdn.ireadabc.com/d07009f1e3878276c6df644faac159d5.mp3"
},
{
"index": [
null,
null,
null,
null,
null,
null,
1
],
"audio": "https://staging-teach.cdn.ireadabc.com/5aaeebe0e5c92dbc8df654f19498e165.mp3"
},
{
"index": [
null,
null,
null,
null,
null,
null,
null,
1
],
"audio": "https://staging-teach.cdn.ireadabc.com/55cb0029f93ab5310a5441ccb8004678.mp3"
},
{
"index": [],
"audio": "https://staging-teach.cdn.ireadabc.com/f0578961665dbdb83c61e0be64711d23.mp3"
},
{
"index": [],
"audio": "https://staging-teach.cdn.ireadabc.com/f0578961665dbdb83c61e0be64711d23.mp3"
}
], ],
"titleObj": [ "titleObj": [
{ {
"card": "A", "card": "t",
"color": 0, "color": 1,
"order": 0 "order": 0
}, },
{ {
"card": "n", "card": "a",
"color": 1, "color": 0,
"order": 1 "order": 1
}, },
{ {
"card": "U", "card": "p",
"color": 0, "color": 1,
"order": 2 "order": 1
}, },
{ {
"card": "m", "card": "e",
"color": 1, "color": 0,
"order": 3 "order": 1
}, }
{
"card": "b",
"color": 0,
"order": 4
},
{
"card": "r",
"color": 1,
"order": 5
},
{
"card": "e",
"color": 1,
"order": 6
},
{
"card": "l",
"color": 1,
"order": 7
},
{
"card": "l",
"color": 1,
"order": -1
},
{
"card": "a",
"color": 1,
"order": -1
},
{
"card": "A",
"color": 1,
"order": -1
},
{
"card": "A",
"color": 1,
"order": -1
}
], ],
"bgImg": "https://staging-teach.cdn.ireadabc.com/2d2e57ba2d66e67aec41fa6ca5cf9f4c.png", "bgImg": "https://staging-teach.cdn.ireadabc.com/2d2e57ba2d66e67aec41fa6ca5cf9f4c.png",
"wordAudio": "https://staging-teach.cdn.ireadabc.com/7c18e0838dcf0707f885842ed09e1579.mp3", "wordAudio": "https://staging-teach.cdn.ireadabc.com/7c18e0838dcf0707f885842ed09e1579.mp3",
...@@ -309,16 +110,9 @@ export const defaultData = { ...@@ -309,16 +110,9 @@ export const defaultData = {
} }
}, },
"orderAudio": [ "orderAudio": [
"https://staging-teach.cdn.ireadabc.com/f0578961665dbdb83c61e0be64711d23.mp3", "http://staging-teach.cdn.ireadabc.com/f6872d4060663e733c9774929b2eeb21.mp3",
"https://staging-teach.cdn.ireadabc.com/c19a36db84b60ad5dc30df8b32d5dd96.mp3", "https://staging-teach.cdn.ireadabc.com/d07009f1e3878276c6df644faac159d5.mp3",
"https://staging-teach.cdn.ireadabc.com/b0d4670315235e5b94ff40de00b6779e.mp3", "https://staging-teach.cdn.ireadabc.com/f0578961665dbdb83c61e0be64711d23.mp3"
"https://staging-teach.cdn.ireadabc.com/a335249581878901140a9ea0395a7201.mp3",
"https://staging-teach.cdn.ireadabc.com/e110cc72cee01e543c69ceb2e94f086e.mp3",
"https://staging-teach.cdn.ireadabc.com/d07009f1e3878276c6df644faac159d5.mp3",
"https://staging-teach.cdn.ireadabc.com/5aaeebe0e5c92dbc8df654f19498e165.mp3",
"https://staging-teach.cdn.ireadabc.com/55cb0029f93ab5310a5441ccb8004678.mp3",
"https://staging-teach.cdn.ireadabc.com/f0578961665dbdb83c61e0be64711d23.mp3",
"https://staging-teach.cdn.ireadabc.com/f0578961665dbdb83c61e0be64711d23.mp3"
] ]
}, },
{ {
......
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