Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
game2048
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王剑峰
game2048
Commits
977c6ace
Commit
977c6ace
authored
Apr 24, 2020
by
huangwenjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
9cecdfa0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
PlayScene.ts
src/scenes/playScene/PlayScene.ts
+8
-2
No files found.
src/scenes/playScene/PlayScene.ts
View file @
977c6ace
...
...
@@ -919,7 +919,7 @@ export class PlayScene extends Scene {
// 随机生成基础元素
generateOneElement
()
{
// 随机生成一个数字 2or4
let
randNumber
=
Math
.
random
()
<
0.9
?
2
:
2048
let
randNumber
=
Math
.
random
()
<
0.9
?
2
:
4
// 随机生成位置
let
randNumberX
=
Math
.
floor
(
Math
.
random
()
*
4
)
let
randNumberY
=
Math
.
floor
(
Math
.
random
()
*
4
)
...
...
@@ -990,7 +990,13 @@ export class PlayScene extends Scene {
gameover
()
{
// 游戏结束
console
.
log
(
"游戏结束"
);
showPanel
(
PropPanel
)
showPanel
(
PropPanel
,
{
bombCount
:
this
.
bombCount
,
exchangeCount
:
this
.
exchangeCount
,
netCount
:
this
.
netCount
,
grade
:
this
.
unlockGrade
,
score
:
this
.
score
,
})
}
isGameWin
()
{
...
...
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