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
a4a9ea8b
Commit
a4a9ea8b
authored
Apr 23, 2020
by
huangwenjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
1a1c751b
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
770 additions
and
49 deletions
+770
-49
bombTips.png
resource/playScene/bombTips.png
+0
-0
doFilterBtn.png
resource/playScene/doFilterBtn.png
+0
-0
exchangeTips.png
resource/playScene/exchangeTips.png
+0
-0
filterTips.png
resource/playScene/filterTips.png
+0
-0
focusTips.png
resource/playScene/focusTips.png
+0
-0
guideArrow.png
resource/playScene/guideArrow.png
+0
-0
guideFinger.png
resource/playScene/guideFinger.png
+0
-0
Check.ts
src/scenes/playScene/Check.ts
+71
-0
GameEle.ts
src/scenes/playScene/GameEle.ts
+21
-18
PlayScene.ts
src/scenes/playScene/PlayScene.ts
+678
-31
No files found.
resource/playScene/bombTips.png
0 → 100644
View file @
a4a9ea8b
5.2 KB
resource/playScene/doFilterBtn.png
0 → 100644
View file @
a4a9ea8b
6.15 KB
resource/playScene/exchangeTips.png
0 → 100644
View file @
a4a9ea8b
5.64 KB
resource/playScene/filterTips.png
0 → 100644
View file @
a4a9ea8b
5.08 KB
resource/playScene/focusTips.png
0 → 100644
View file @
a4a9ea8b
1.01 KB
resource/playScene/guideArrow.png
0 → 100644
View file @
a4a9ea8b
251 Bytes
resource/playScene/guideFinger.png
0 → 100644
View file @
a4a9ea8b
4.1 KB
src/scenes/playScene/Check.ts
0 → 100644
View file @
a4a9ea8b
export
const
noBlockLeft
=
(
x
,
y
,
yl
,
beforeArr
)
=>
{
if
(
y
>
yl
+
1
)
{
for
(
let
t
=
yl
-
1
;
t
<
y
;
t
++
)
{
if
(
beforeArr
[
x
][
y
]
!==
0
)
{
return
false
}
}
}
if
(
y
<
yl
+
1
)
{
for
(
let
t
=
y
-
1
;
t
<
yl
;
t
++
)
{
if
(
beforeArr
[
x
][
y
]
!==
0
)
{
return
false
}
}
}
return
true
}
export
const
noBlockRight
=
(
x
,
y
,
yr
,
beforeArr
)
=>
{
if
(
yr
>
y
+
1
)
{
for
(
let
t
=
y
-
1
;
t
<
yr
;
t
++
)
{
if
(
beforeArr
[
x
][
y
]
!==
0
)
{
return
false
}
}
}
if
(
yr
<
y
+
1
)
{
for
(
let
t
=
yr
-
1
;
t
<
y
;
t
++
)
{
if
(
beforeArr
[
x
][
y
]
!==
0
)
{
return
false
}
}
}
return
true
}
export
const
noBlockTop
=
(
x
,
xt
,
y
,
beforeArr
)
=>
{
if
(
x
>
xt
+
1
)
{
for
(
let
t
=
xt
-
1
;
t
<
x
;
t
++
)
{
if
(
beforeArr
[
x
][
y
]
!==
0
)
{
return
false
}
}
}
if
(
x
<
xt
+
1
)
{
for
(
let
t
=
x
-
1
;
t
<
xt
;
t
++
)
{
if
(
beforeArr
[
x
][
y
]
!==
0
)
{
return
false
}
}
}
return
true
}
export
const
noBlockBottom
=
(
x
,
xb
,
y
,
beforeArr
)
=>
{
if
(
xb
>
x
+
1
)
{
for
(
let
t
=
x
-
1
;
t
<
xb
;
t
++
)
{
if
(
beforeArr
[
x
][
y
]
!==
0
)
{
return
false
}
}
}
if
(
xb
<
x
+
1
)
{
for
(
let
t
=
x
-
1
;
t
<
xb
;
t
++
)
{
if
(
beforeArr
[
x
][
y
]
!==
0
)
{
return
false
}
}
}
return
true
}
\ No newline at end of file
src/scenes/playScene/GameEle.ts
View file @
a4a9ea8b
...
...
@@ -17,55 +17,58 @@ export class GameEle extends Sprite {
switch
(
eleType
+
""
)
{
case
"2"
:
this
.
texture
=
RES
.
getRes
(
"ele2.png"
)
this
.
x
=
5
this
.
y
=
-
5
this
.
x
=
10
this
.
y
=
20
break
case
"4"
:
this
.
texture
=
RES
.
getRes
(
"ele4.png"
)
this
.
x
=
-
10
this
.
y
=
-
5
this
.
x
=
-
2
this
.
y
=
20
break
case
"8"
:
this
.
texture
=
RES
.
getRes
(
"ele8.png"
)
this
.
y
=
-
5
this
.
x
=
5
this
.
y
=
20
break
case
"16"
:
this
.
texture
=
RES
.
getRes
(
"ele16.png"
)
this
.
x
=
5
this
.
y
=
-
15
this
.
x
=
12
this
.
y
=
15
break
case
"32"
:
this
.
texture
=
RES
.
getRes
(
"ele32.png"
)
this
.
y
=
-
10
this
.
x
=
8
this
.
y
=
20
break
case
"64"
:
this
.
texture
=
RES
.
getRes
(
"ele64.png"
)
this
.
y
=
-
15
this
.
x
=
8
this
.
y
=
16
break
case
"128"
:
this
.
texture
=
RES
.
getRes
(
"ele128.png"
)
this
.
x
=
5
this
.
y
=
-
1
0
this
.
x
=
8
this
.
y
=
2
0
break
case
"256"
:
this
.
texture
=
RES
.
getRes
(
"ele256.png"
)
this
.
x
=
5
this
.
y
=
-
1
0
this
.
x
=
8
this
.
y
=
2
0
break
case
"512"
:
this
.
texture
=
RES
.
getRes
(
"ele512.png"
)
this
.
x
=
5
this
.
y
=
-
1
0
this
.
x
=
8
this
.
y
=
2
0
break
case
"1024"
:
this
.
texture
=
RES
.
getRes
(
"ele1024.png"
)
this
.
x
=
10
this
.
y
=
-
1
0
this
.
y
=
2
0
break
case
"2048"
:
this
.
texture
=
RES
.
getRes
(
"ele2048.png"
)
this
.
x
=
5
this
.
y
=
-
1
0
this
.
x
=
8
this
.
y
=
2
0
break
default
:
this
.
texture
=
Texture
.
EMPTY
...
...
src/scenes/playScene/PlayScene.ts
View file @
a4a9ea8b
This diff is collapsed.
Click to expand it.
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