Commit ef3c4f37 authored by liujiangnan's avatar liujiangnan

feat: 防止连点

parent b45cc5e6
...@@ -345,6 +345,7 @@ cc.Class({ ...@@ -345,6 +345,7 @@ cc.Class({
}, },
gameNextFlag: null,
createBall(answer) { createBall(answer) {
let ball = null; let ball = null;
if (answer.answerType == 'img') { if (answer.answerType == 'img') {
...@@ -396,7 +397,8 @@ cc.Class({ ...@@ -396,7 +397,8 @@ cc.Class({
this._status.currentRightNumber++; this._status.currentRightNumber++;
const currentQuestion = this.data.questionList[this._status.currentQuestionIdx]; const currentQuestion = this.data.questionList[this._status.currentQuestionIdx];
this.updateRightNumber(); this.updateRightNumber();
if (this._status.currentRightNumber >= currentQuestion.rigthNumber) { if (this._status.currentRightNumber >= currentQuestion.rigthNumber && !this.gameNextFlag) {
this.gameNextFlag = true;
this.stopShowBalls(); this.stopShowBalls();
await asyncDelay(0.5); await asyncDelay(0.5);
await this.showStar(); await this.showStar();
...@@ -409,6 +411,7 @@ cc.Class({ ...@@ -409,6 +411,7 @@ cc.Class({
await this.playQuestionAudio(); await this.playQuestionAudio();
this.startShowBalls(); this.startShowBalls();
} }
this.gameNextFlag = false;
} }
}); });
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 76, "height": 76,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"彩带": { "cd": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "fae2e4dd-cbd3-4a27-8506-c6a2b11da5c6", "uuid": "fae2e4dd-cbd3-4a27-8506-c6a2b11da5c6",
"rawTextureUuid": "afcdd4b4-7d30-4229-b7bc-549324e9a8f5", "rawTextureUuid": "afcdd4b4-7d30-4229-b7bc-549324e9a8f5",
......
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