Commit 11b9a26c authored by limingzhe's avatar limingzhe

fix: debug

parent bf32a77e
......@@ -168,18 +168,27 @@ cc.Class({
const BtnStart = cc.find('Canvas/bg/BtnStart');
addBtnListener(BtnStart, async () => {
await asyncTweenTo(BtnStart, 0.1, { opacity: 0 });
if (this.isDestroy) {
return;
}
BtnStart.active = false;
this.gameStart();
}, this.playAudio.bind(this, 'btn'));
const BtnRestart = cc.find('Canvas/bg/BtnRestart');
addBtnListener(BtnRestart, async () => {
await asyncTweenTo(BtnRestart, 0.1, { opacity: 0 });
if (this.isDestroy) {
return;
}
BtnRestart.active = false;
this.gameStart();
}, this.playAudio.bind(this, 'btn'));
const BtnSpeaker = cc.find('Canvas/bg/BtnSpeaker');
addBtnListener(BtnSpeaker, async () => {
await this.playQuestionAudio();
if (this.isDestroy) {
return;
}
});
const bg = cc.find('Canvas/bg');
......@@ -289,8 +298,14 @@ cc.Class({
};
this.createStars();
await this.showGuns();
if (this.isDestroy) {
return;
}
await this.playQuestionAudio();
if (this.isDestroy) {
return;
}
this.startShowBalls();
},
......@@ -395,6 +410,9 @@ cc.Class({
}
const location = event.getLocation();
await this.shootTarget(ball, location, true);
if (this.isDestroy) {
return;
}
if (!answer.rightAnswer) {
this.targetLaugh(ball);
return;
......@@ -407,14 +425,26 @@ cc.Class({
this.gameNextFlag = true;
this.stopShowBalls();
await asyncDelay(0.5);
if (this.isDestroy) {
return;
}
await this.showStar();
if (this.isDestroy) {
return;
}
this._status.currentRightNumber = 0;
this._status.currentQuestionIdx++;
if (this.isEndGame()) {
this.onGameEnd();
} else {
await asyncDelay(1.5);
if (this.isDestroy) {
return;
}
await this.playQuestionAudio();
if (this.isDestroy) {
return;
}
this.startShowBalls();
}
this.gameNextFlag = false;
......
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