Commit 6c49b45a authored by 李维's avatar 李维

修改随机的泡泡数

parent 8c881d66
......@@ -83,7 +83,12 @@ cc.Class({
getData((data) => {
console.log('data:', data);
this.data = this.translateData(data.rows) || this.getDefaultData();
if(data.rows) {
this.data = this.translateData(data.rows)
} else {
this.data = this.getDefaultData();
}
this.data = JSON.parse(JSON.stringify(this.data));
this.preloadItem()
this.preloadItem(_=>{
......@@ -110,6 +115,10 @@ cc.Class({
})
},
destroyed() {
this.gameLogic.destroyed && this.gameLogic.destroyed();
},
getData(cb) {
let data;
......@@ -163,17 +172,17 @@ cc.Class({
}
}
data.forEach((item, index)=>{
const errItem = getErrDataItem(data, index, 1);
const errItem = getErrDataItem(data, index, 5);
const configItem = {
"correct": [],
"incorrect": [],
"audio_url1": item.audio_url
"audio_url1": item.audio_cn_url
}
configItem.correct.push({
"type": "Text",
"text": item.text_en,
"audio_url": item.audio_url,
"audio_url": item.audio_cn_url,
"image_url": ""
})
......@@ -181,7 +190,7 @@ cc.Class({
configItem.incorrect.push({
"type": "Text",
"text": eItem.text_en,
"audio_url": eItem.audio_url,
"audio_url": eItem.audio_cn_url,
"image_url": ""
})
})
......
......@@ -16,6 +16,7 @@ export default class GameLogic {
g_audioResList = [];
g_animaResList = [];
g_properties = {};
g_timeoutIds = [];
m_bubblesAll = [];
m_currentQuestion = -1;
......@@ -26,6 +27,7 @@ export default class GameLogic {
m_isPlayingAudio = false;
m_sysIntervalId = null;
constructor(formData, systemOption) {
this.g_systemOption = systemOption;
this.g_imageResList = this.g_systemOption.imageResList;
......@@ -151,9 +153,9 @@ export default class GameLogic {
let a = btn_lion.node.getComponent(dragonBones.ArmatureDisplay)
a.playAnimation(aniName, 1);
setTimeout(() => {
this.g_timeoutIds.push(setTimeout(() => {
a.playAnimation(aniName, -1);
}, 3200);
}, 3200))
}
......@@ -569,10 +571,10 @@ export default class GameLogic {
this.m_bubblesAll = this.save;
return new Promise((resolve, reject)=>{
setTimeout(() => {
this.g_timeoutIds.push(setTimeout(() => {
resolve();
this.enableClick("DestroyBubbles")
}, 1100);
}, 1100));
})
}
......@@ -614,12 +616,12 @@ export default class GameLogic {
bubble.move.vX = vArr[count%4].vX
bubble.move.vY = vArr[count%4].vY
count++;
setTimeout(() => {
this.g_timeoutIds.push(setTimeout(() => {
this.g_cartoon.playAudio("出现")
this.g_cartoon.tweenChange(bubble.node, {scale: this.m_maxScale, x: bubble.move.x, y: bubble.move.y}, 3, _=>{
resolve()
})
}, 200 * index);
}, 200 * index));
})
pAll.push(_p)
}
......@@ -683,9 +685,9 @@ export default class GameLogic {
asyncDelay(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
this.g_timeoutIds.push(setTimeout(() => {
resolve();
}, time * 1000);
}, time * 1000));
})
}
......@@ -744,7 +746,9 @@ export default class GameLogic {
});
}
destroyed() {
console.log("DES")
}
......
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