Commit 5f3f4903 authored by asdf's avatar asdf

播放音乐和移动的时候也可以切换至下一页

parent 35db1014
......@@ -37,7 +37,6 @@ cc.Class({
initSceneData() {
this._resList = [];
window.GameData = {};
GameData.audioCount = 0;
},
_designSize: null, // 设计分辨率
......@@ -121,6 +120,8 @@ cc.Class({
initData() {
// 所有全局变量 默认都是null
GameData.audioCount = 0;
let optionList = this.data.questionList[GameData.questionIndex].optionList;
this.optionList = [];
for (let i = 0; i < optionList.length; i++) {
......@@ -297,40 +298,25 @@ cc.Class({
},
onTurnLast() {
if (GameData.isMoving) {
return;
}
if (GameData.audioCount != 0) {
return;
}
GameData.questionIndex--;
this.nodeDict.nodAnswerParent.destroyAllChildren();
this.nodeDict.nodQuestionParent.destroyAllChildren();
cc.audioEngine.stopAll();
GameData.questionIndex--;
this.initData();
this.playAudioQuestion();
},
onReplay() {
if (GameData.isMoving) {
return;
}
if (GameData.audioCount != 0) {
return;
}
this.nodeDict.nodAnswerParent.destroyAllChildren();
this.nodeDict.nodQuestionParent.destroyAllChildren();
cc.audioEngine.stopAll();
this.initData();
this.startGame();
},
onTurnNext() {
if (GameData.isMoving) {
return;
}
if (GameData.audioCount != 0) {
return;
}
GameData.questionIndex++;
this.nodeDict.nodAnswerParent.destroyAllChildren();
this.nodeDict.nodQuestionParent.destroyAllChildren();
cc.audioEngine.stopAll();
GameData.questionIndex++;
this.initData();
this.startGame();
},
......
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