Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MingSnake_241120
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
MingSnake_241120
Commits
69ead5e9
Commit
69ead5e9
authored
Nov 26, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
dd3dab31
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
MainGame.ts
assets/Scripts/Scenes/MainGame/MainGame.ts
+6
-4
No files found.
assets/Scripts/Scenes/MainGame/MainGame.ts
View file @
69ead5e9
...
...
@@ -85,6 +85,12 @@ export class MainGame extends Scene {
this
.
uiBg
.
getComponent
(
UITransform
)
.
setContentSize
(
Global
.
MAP_WIDTH
,
Global
.
MAP_HEIGHT
);
// 注册事件
director
.
on
(
Events
.
showGOver
,
this
.
showGOver
,
this
);
director
.
on
(
Events
.
setGameState
,
this
.
setGameState
,
this
);
}
start
()
{
this
.
player
.
init
({
// initEnergy: 10000
nickName
:
"我"
,
...
...
@@ -99,10 +105,6 @@ export class MainGame extends Scene {
// 设置游戏状态
this
.
setGameState
(
GameState
.
PLAY
);
// 注册事件
director
.
on
(
Events
.
showGOver
,
this
.
showGOver
,
this
);
director
.
on
(
Events
.
setGameState
,
this
.
setGameState
,
this
);
}
onDestroy
()
{
...
...
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