Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RB_StrongestBrain_250520
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
RB_StrongestBrain_250520
Commits
2b80b8e1
Commit
2b80b8e1
authored
May 27, 2025
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11
parent
054eb652
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
gameStore.ts
src/store/gameStore.ts
+12
-0
No files found.
src/store/gameStore.ts
View file @
2b80b8e1
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment