Commit 2b80b8e1 authored by haiyoucuv's avatar haiyoucuv

11

parent 054eb652
......@@ -21,6 +21,7 @@ class GameStore {
countdownSeconds: 180,
remainTipTimes: 0,
cd: 180,
isSubmit: false,
}
async start() {
......@@ -35,6 +36,7 @@ class GameStore {
this.gameInfo.levelIdxArr = LevelArr.map((_, index) => index);
this.gameInfo.levelIdxArr.sort(() => Math.random() - 0.5);
this.gameInfo.levelIndex = -1;
this.gameInfo.isSubmit = false;
this.gameInfo.recordId = data.recordId;
this.gameInfo.countdownSeconds = data.countdownSeconds;
this.gameInfo.remainTipTimes = data.remainTipTimes
......@@ -48,6 +50,10 @@ class GameStore {
}
async middleSubmit(score: number) {
if (this.gameInfo.isSubmit) {
return;
}
const d = {
recordId: this.gameInfo.recordId,
score,
......@@ -61,6 +67,12 @@ class GameStore {
}
async submit(score: number) {
if (this.gameInfo.isSubmit) {
return;
}
this.gameInfo.isSubmit = true;
const d = {
recordId: this.gameInfo.recordId,
score,
......
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