Commit dcbabc03 authored by asdf's avatar asdf

.

parent 190982c2
...@@ -253,6 +253,9 @@ cc.Class({ ...@@ -253,6 +253,9 @@ cc.Class({
playLabelGreen(cb) { playLabelGreen(cb) {
this.dragonBone.playAnimation(this.animationName, 1); this.dragonBone.playAnimation(this.animationName, 1);
this.playAudioOption((duration) => { this.playAudioOption((duration) => {
if(!cc.isValid(this)){
return;
}
this.scheduleStep = 2; this.scheduleStep = 2;
this.scheduleDuration = duration / 2 / this.label.node.width * this.scheduleStep; this.scheduleDuration = duration / 2 / this.label.node.width * this.scheduleStep;
if (this.scheduleDuration < 0.05) { if (this.scheduleDuration < 0.05) {
......
...@@ -353,6 +353,9 @@ cc.Class({ ...@@ -353,6 +353,9 @@ cc.Class({
), ),
cc.callFunc(() => { cc.callFunc(() => {
itemAnswer.playLabelGreen(()=>{ itemAnswer.playLabelGreen(()=>{
if(GameData.isOver){
return;
}
if (this.checkOver()) { if (this.checkOver()) {
this.showLayerOver(); this.showLayerOver();
} }
...@@ -422,20 +425,20 @@ cc.Class({ ...@@ -422,20 +425,20 @@ cc.Class({
GameData.startStepDone = false; GameData.startStepDone = false;
}, },
onTurnLast() { onTurnLast() {
if(GameData.isOver){ if (GameData.audioCount != 0) {
return; return;
} }
GameData.questionIndex--; GameData.questionIndex--;
this.resetDate(); this.resetDate();
}, },
onReplay() { onReplay() {
if(GameData.isOver){ if (GameData.audioCount != 0) {
return; return;
} }
this.resetDate(); this.resetDate();
}, },
onTurnNext() { onTurnNext() {
if(GameData.isOver){ if (GameData.audioCount != 0) {
return; return;
} }
GameData.questionIndex++; GameData.questionIndex++;
...@@ -450,9 +453,6 @@ cc.Class({ ...@@ -450,9 +453,6 @@ cc.Class({
if (GameData.audioCount != 0) { if (GameData.audioCount != 0) {
return; return;
} }
if(GameData.isOver){
return;
}
this.playAudioPage(true); this.playAudioPage(true);
} else if (button.node.name == 'btnLast') { } else if (button.node.name == 'btnLast') {
this.onTurnLast(); this.onTurnLast();
...@@ -461,9 +461,6 @@ cc.Class({ ...@@ -461,9 +461,6 @@ cc.Class({
} else if (button.node.name == 'btnNext') { } else if (button.node.name == 'btnNext') {
this.onTurnNext(); this.onTurnNext();
} else if (button.node.name == 'btnAudio') { } else if (button.node.name == 'btnAudio') {
if(GameData.isOver){
return;
}
this.onBtnClickAudio(); this.onBtnClickAudio();
} }
}, },
......
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