Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
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
wildfirecode13
xiaoxiaole
Commits
7ed69a67
Commit
7ed69a67
authored
Oct 25, 2019
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
58fd7a01
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
22 deletions
+28
-22
MainScene.ts
egret/src/mainScene/MainScene.ts
+28
-22
No files found.
egret/src/mainScene/MainScene.ts
View file @
7ed69a67
...
@@ -166,8 +166,8 @@ export default class MainScene extends Scene {
...
@@ -166,8 +166,8 @@ export default class MainScene extends Scene {
* 判断连通的状态
* 判断连通的状态
* 1表示存在小列连通到大列,从右往左遍历
* 1表示存在小列连通到大列,从右往左遍历
* 2表示存在大列连通到小烈,从左往右遍历
* 2表示存在大列连通到小烈,从左往右遍历
* 3表示都有,遍历两边,down
的
大,从右先
* 3表示都有,遍历两边,down
比up
大,从右先
* 4表示都有,遍历两边,down
的
小,从左先
* 4表示都有,遍历两边,down
比up
小,从左先
*/
*/
connectState
:
number
=
2
;
connectState
:
number
=
2
;
//皮肤上的
//皮肤上的
...
@@ -482,7 +482,7 @@ export default class MainScene extends Scene {
...
@@ -482,7 +482,7 @@ export default class MainScene extends Scene {
this
.
generateIndexs
=
Tool
.
setGenerateLats
(
this
.
lattices
,
this
.
chapterData
.
map
.
generateLats
||
[])
this
.
generateIndexs
=
Tool
.
setGenerateLats
(
this
.
lattices
,
this
.
chapterData
.
map
.
generateLats
||
[])
var
downMax
:
number
=
0
;
var
downMax
:
number
=
0
;
var
downMin
:
number
=
Tool
.
colNum
-
1
;
var
upMax
:
number
=
0
;
var
hasSmallToBig
:
boolean
;
var
hasSmallToBig
:
boolean
;
var
hasBigToSmall
:
boolean
;
var
hasBigToSmall
:
boolean
;
//联通口
//联通口
...
@@ -494,6 +494,8 @@ export default class MainScene extends Scene {
...
@@ -494,6 +494,8 @@ export default class MainScene extends Scene {
var
colUp
=
Tool
.
indexToRc
(
connectedLat
[
0
])[
1
];
var
colUp
=
Tool
.
indexToRc
(
connectedLat
[
0
])[
1
];
var
colDown
=
Tool
.
indexToRc
(
connectedLat
[
1
])[
1
];
var
colDown
=
Tool
.
indexToRc
(
connectedLat
[
1
])[
1
];
downMax
=
Math
.
max
(
downMax
,
colDown
);
upMax
=
Math
.
max
(
upMax
,
colUp
);
if
(
colUp
>
colDown
)
{
if
(
colUp
>
colDown
)
{
hasBigToSmall
=
true
;
hasBigToSmall
=
true
;
}
}
...
@@ -503,10 +505,14 @@ export default class MainScene extends Scene {
...
@@ -503,10 +505,14 @@ export default class MainScene extends Scene {
}
}
//1表示存在小列连通到大列,从右往左遍历
//1表示存在小列连通到大列,从右往左遍历
//2表示存在大列连通到小烈,从左往右遍历
//2表示存在大列连通到小烈,从左往右遍历
//3表示都有,遍历两边,down
的
大,从右先
//3表示都有,遍历两边,down
比up
大,从右先
//4表示都有,遍历两边,down
的
小,从左先
//4表示都有,遍历两边,down
比up
小,从左先
if
(
hasBigToSmall
&&
hasSmallToBig
)
{
if
(
hasBigToSmall
&&
hasSmallToBig
)
{
if
(
downMax
>
upMax
)
{
this
.
connectState
=
3
;
}
else
{
this
.
connectState
=
4
;
}
}
}
else
if
(
hasBigToSmall
)
{
else
if
(
hasBigToSmall
)
{
this
.
connectState
=
2
;
this
.
connectState
=
2
;
...
@@ -1058,7 +1064,7 @@ export default class MainScene extends Scene {
...
@@ -1058,7 +1064,7 @@ export default class MainScene extends Scene {
if
(
/*!this.fallVerMark ||*/
Tool
.
judgeOutOne
(
this
.
emptys
,
this
.
lattices
))
{
if
(
/*!this.fallVerMark ||*/
Tool
.
judgeOutOne
(
this
.
emptys
,
this
.
lattices
))
{
// this.fallVerMark = true;
// this.fallVerMark = true;
var
anis
=
this
.
fallVerticalEx
();
var
anis
=
this
.
fallVerticalEx
();
anis
=
anis
.
concat
(
this
.
fallVerticalEx
())
//
anis = anis.concat(this.fallVerticalEx())
// anis = anis.concat(this.fallSkewEx())
// anis = anis.concat(this.fallSkewEx())
if
(
!
anis
.
length
)
{
if
(
!
anis
.
length
)
{
anis
=
this
.
fallSkewEx
()
anis
=
this
.
fallSkewEx
()
...
@@ -1146,8 +1152,8 @@ export default class MainScene extends Scene {
...
@@ -1146,8 +1152,8 @@ export default class MainScene extends Scene {
fallVerticalEx
()
{
fallVerticalEx
()
{
//1表示存在小列连通到大列,从右往左遍历
//1表示存在小列连通到大列,从右往左遍历
//2表示存在大列连通到小烈,从左往右遍历
//2表示存在大列连通到小烈,从左往右遍历
//3表示都有,遍历两边,down
的
大,从右先
//3表示都有,遍历两边,down
比up
大,从右先
//4表示都有,遍历两边,down
的
小,从左先
//4表示都有,遍历两边,down
比up
小,从左先
var
anis
:
FallAniData
[]
=
[]
var
anis
:
FallAniData
[]
=
[]
let
operation
=
(
m
)
=>
{
let
operation
=
(
m
)
=>
{
//同一列,先原有的填满,再查是否有生成口
//同一列,先原有的填满,再查是否有生成口
...
@@ -1210,20 +1216,20 @@ export default class MainScene extends Scene {
...
@@ -1210,20 +1216,20 @@ export default class MainScene extends Scene {
}
}
}
}
}
}
if
(
this
.
connectState
==
1
)
{
//
if (this.connectState == 1) {
for
(
var
m
=
Tool
.
colNum
;
m
>=
0
;
m
++
)
operation
(
m
)
//
for (var m = Tool.colNum; m >= 0; m++)operation(m)
}
//
}
else
if
(
this
.
connectState
==
2
)
{
//
else if (this.connectState == 2) {
for
(
var
m
=
0
;
m
<
Tool
.
colNum
;
m
++
)
operation
(
m
)
for
(
var
m
=
0
;
m
<
Tool
.
colNum
;
m
++
)
operation
(
m
)
}
//
}
else
if
(
this
.
connectState
==
3
)
{
//
else if (this.connectState == 3) {
for
(
var
m
=
Tool
.
colNum
;
m
>=
0
;
m
++
)
operation
(
m
);
//
for (var m = Tool.colNum; m >= 0; m++) operation(m);
for
(
var
m
=
0
;
m
<
Tool
.
colNum
;
m
++
)
operation
(
m
);
//
for (var m = 0; m < Tool.colNum; m++) operation(m);
}
//
}
else
if
(
this
.
connectState
==
4
)
{
//
else if (this.connectState == 4) {
for
(
var
m
=
0
;
m
<
Tool
.
colNum
;
m
++
)
operation
(
m
);
//
for (var m = 0; m < Tool.colNum; m++) operation(m);
for
(
var
m
=
Tool
.
colNum
;
m
>=
0
;
m
++
)
operation
(
m
);
//
for (var m = Tool.colNum; m >= 0; m++) operation(m);
}
//
}
return
anis
;
return
anis
;
}
}
...
...
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