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
bdd543d4
Commit
bdd543d4
authored
Apr 24, 2020
by
huangwenjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
82a944d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
PlayScene.ts
src/scenes/playScene/PlayScene.ts
+15
-14
No files found.
src/scenes/playScene/PlayScene.ts
View file @
bdd543d4
import
{
PropPanel
}
from
'./../../panels/PropPanel'
;
import
{
QuitPanel
}
from
'./../../panels/QuitPanel'
;
import
{
PropOutPanel
}
from
'./../../panels/PropOutPanel'
;
import
{
showWaiting
,
hideWaiting
}
from
'./../../../module/ctrls/waitingCtrl'
;
...
...
@@ -452,8 +453,8 @@ export class PlayScene extends Scene {
getTools
()
if
(
!
this
.
isGameWin
())
this
.
isGameOver
()
//
if (!this.isGameWin())
this
.
isGameOver
()
},
PropType
.
exchange
)
}
else
if
(
this
.
exchangeTargetPool
.
length
=
1
)
{
for
(
let
x
=
0
;
x
<
4
;
x
++
)
{
...
...
@@ -685,8 +686,8 @@ export class PlayScene extends Scene {
this
.
removeChild
(
this
.
doFilterBtn
)
this
.
filtering
=
false
this
.
removeAnis
()
if
(
!
this
.
isGameWin
())
this
.
isGameOver
()
//
if (!this.isGameWin())
this
.
isGameOver
()
},
300
);
},
PropType
.
net
)
},
this
)
...
...
@@ -817,8 +818,8 @@ export class PlayScene extends Scene {
await
this
.
moveAni
(
beforeArr
)
this
.
renderBoard
()
this
.
generateOneElement
()
if
(
!
this
.
isGameWin
())
this
.
isGameOver
()
//
if (!this.isGameWin())
this
.
isGameOver
()
}
}
if
(
this
.
offsetX
<
0
)
{
...
...
@@ -828,8 +829,8 @@ export class PlayScene extends Scene {
await
this
.
moveAni
(
beforeArr
)
this
.
renderBoard
()
this
.
generateOneElement
()
if
(
!
this
.
isGameWin
())
this
.
isGameOver
()
//
if (!this.isGameWin())
this
.
isGameOver
()
}
}
}
else
{
...
...
@@ -841,8 +842,8 @@ export class PlayScene extends Scene {
await
this
.
moveAni
(
beforeArr
)
this
.
renderBoard
()
this
.
generateOneElement
()
if
(
!
this
.
isGameWin
())
this
.
isGameOver
()
//
if (!this.isGameWin())
this
.
isGameOver
()
}
}
if
(
this
.
offsetY
<
0
)
{
...
...
@@ -852,8 +853,8 @@ export class PlayScene extends Scene {
await
this
.
moveAni
(
beforeArr
)
this
.
renderBoard
()
this
.
generateOneElement
()
if
(
!
this
.
isGameWin
())
this
.
isGameOver
()
//
if (!this.isGameWin())
this
.
isGameOver
()
}
}
}
...
...
@@ -989,7 +990,7 @@ export class PlayScene extends Scene {
gameover
()
{
// 游戏结束
console
.
log
(
"游戏结束"
);
showPanel
(
PropPanel
)
}
isGameWin
()
{
...
...
@@ -1166,7 +1167,7 @@ export class PlayScene extends Scene {
let
addScore
=
0
for
(
let
i
=
1
;
i
<
arr
.
length
;
i
++
)
{
if
(
arr
[
i
]
===
0
)
break
if
(
arr
[
i
]
===
arr
[
i
-
1
])
{
if
(
arr
[
i
]
===
arr
[
i
-
1
]
&&
arr
[
i
-
1
]
<
2048
)
{
// fromIdx 要改成转换前的idx
// this.moveData[t].push({ "fromValue": arr[i - 1], "toValue": arr[i - 1] * 2, "fromIdx": i, "toIdx": i - 1 })
...
...
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