Commit 9f04ce0b authored by 李维's avatar 李维

清除setTimeout

parent 804ad5ef
......@@ -184,6 +184,9 @@ cc.Class({
console.log('showGameOver');
// this.moveGrassInterval
clearInterval(this.moveGrassInterval);
this.timeoutsIds.forEach(id=>{
clearTimeout(id)
})
cc.director.loadScene('sn11_zmxz_end');
},
......@@ -408,6 +411,7 @@ cc.Class({
imgCharactor.scale = 1;
},
timeoutsIds: [],
showOptions() {
const nodeOptions = cc.find('Canvas/NodeOptions');
nodeOptions.zIndex = 10;
......@@ -425,6 +429,7 @@ cc.Class({
nodeOption.scale = 1;
const btnOption = cc.find(`Canvas/NodeOptions/NodeOption_${i}/BtnOption`)
this.timeoutsIds.push(
setTimeout(() => {
cc.tween(btnOption)
.by(2.5, { y: 20 }, { easing: 'cubicInOut' })
......@@ -432,7 +437,7 @@ cc.Class({
.union()
.repeatForever()
.start();
}, Math.random() * 2000);
}, Math.random() * 2000));
const label = cc.find(`Canvas/NodeOptions/NodeOption_${i}/BtnOption/LabelOption`)
label.getComponent(cc.Label).string = wordList[i];
......
module.exports = {
roundList: [{
audio: 'ball',
questionList: [{
rightAudio: 'b',
rightWord: 'b',
wrongWordList: ['p', 'd'],
wrongAudioList: ['p.mp3', 'd.mp3'],
}, {
rightAudio: 'a',
rightWord: 'all',
wrongWordList: ['ao', 'arl'],
wrongAudioList: ['ao.mp3', 'arl.mp3'],
}]
}],
"bgAudio": true,
"roundList": [
{
"audio": "http://staging-teach.cdn.ireadabc.com/ec19a2c73ec4fca0bf0458c74381a702.mp3",
"questionList": [
{
"rightAudio": "http://staging-teach.cdn.ireadabc.com/b4673919e9942df87851ad70fae5d5ba.mp3",
"rightWord": "j",
"wrongWordList": [
"r",
"t"
],
"wrongAudioList": [
"http://staging-teach.cdn.ireadabc.com/59a72e6ecfa057f8f6da2626a96d3669.mp3",
"http://staging-teach.cdn.ireadabc.com/163441a48b0325b021baddfa3cdc1f3d.mp3"
]
},
{
"rightAudio": "http://staging-teach.cdn.ireadabc.com/3a2459fbf41e71d847dbc1e1d8344174.mp3",
"rightWord": "i",
"wrongWordList": [
"c",
"o"
],
"wrongAudioList": [
"http://staging-teach.cdn.ireadabc.com/46d0c82dfa618ae6e375dd6353cd7323.mp3",
"http://staging-teach.cdn.ireadabc.com/937fc595d0bd23321fc3559a97e0aa55.mp3"
]
}
]
}
]
}
\ No newline at end of file
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