Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
LuzhouLaojiaoSnake_250428
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
LuzhouLaojiaoSnake_250428
Commits
18030d40
Commit
18030d40
authored
May 07, 2025
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
倒计时
parent
553a1938
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
4 deletions
+15
-4
GamePage.tsx
src/pages/GamePage/GamePage.tsx
+6
-0
FailPanel.tsx
src/panels/FailPanel/FailPanel.tsx
+3
-0
SucPanel.tsx
src/panels/SucPanel/SucPanel.tsx
+3
-0
gameStore.ts
src/store/gameStore.ts
+3
-4
No files found.
src/pages/GamePage/GamePage.tsx
View file @
18030d40
...
...
@@ -32,6 +32,8 @@ export interface IGamePageState {
@
observer
class
GamePage
extends
React
.
Component
{
gameOver
:
boolean
=
false
;
state
:
IGamePageState
=
{
}
...
...
@@ -69,6 +71,8 @@ class GamePage extends React.Component {
if
(
gameStore
.
gameInfo
.
cd
<=
0
)
{
clearInterval
(
this
.
interval
);
gameStore
.
gameInfo
.
cd
=
0
;
this
.
gameOver
=
true
;
gameStore
.
submit
();
}
},
1000
);
}
...
...
@@ -120,6 +124,8 @@ class GamePage extends React.Component {
}
onUpdate
=
(
time
:
Ticker
)
=>
{
if
(
this
.
gameOver
)
return
;
Tween
.
flush
();
this
.
game
.
onUpdate
(
time
);
collisionSys
.
update
();
...
...
src/panels/FailPanel/FailPanel.tsx
View file @
18030d40
...
...
@@ -4,6 +4,8 @@ import "./FailPanel.less";
import
{
Button
}
from
"@grace/ui"
;
import
{
_asyncThrottle
}
from
"@/utils/utils.ts"
;
import
{
ModalCtrl
}
from
"@/core/ctrls/ModalCtrl.tsx"
;
import
{
PageCtrl
}
from
"@/core/ctrls/PageCtrl.tsx"
;
import
HomePage
from
"@/pages/HomePage/HomePage.tsx"
;
export
interface
IFailPanelProps
{
score
:
number
,
...
...
@@ -21,6 +23,7 @@ class FailPanel extends React.Component<IFailPanelProps> {
clickClose
=
()
=>
{
ModalCtrl
.
closeModal
();
PageCtrl
.
changePage
(
HomePage
);
};
clickBtn
=
_asyncThrottle
(
async
()
=>
{
...
...
src/panels/SucPanel/SucPanel.tsx
View file @
18030d40
...
...
@@ -4,6 +4,8 @@ import "./SucPanel.less";
import
{
Button
}
from
"@grace/ui"
;
import
{
_asyncThrottle
}
from
"@/utils/utils.ts"
;
import
{
ModalCtrl
}
from
"@/core/ctrls/ModalCtrl.tsx"
;
import
{
PageCtrl
}
from
"@/core/ctrls/PageCtrl.tsx"
;
import
HomePage
from
"@/pages/HomePage/HomePage.tsx"
;
export
interface
ISucPanelProps
{
score
:
number
,
...
...
@@ -21,6 +23,7 @@ class SucPanel extends React.Component<ISucPanelProps> {
clickClose
=
()
=>
{
ModalCtrl
.
closeModal
();
PageCtrl
.
changePage
(
HomePage
);
};
clickBtn
=
_asyncThrottle
(
async
()
=>
{
...
...
src/store/gameStore.ts
View file @
18030d40
...
...
@@ -80,10 +80,9 @@ class GameStore {
}
}
async
submit
(
score
:
number
)
{
const
recordId
=
this
.
startInfo
.
recordId
;
async
submit
()
{
const
{
recordId
}
=
this
.
startInfo
;
const
{
score
}
=
this
.
gameInfo
;
const
param
=
AESEncrypt
(
JSON
.
stringify
({
timestamp
:
Date
.
now
(),
recordId
,
...
...
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