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
c38b861d
Commit
c38b861d
authored
May 07, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码暂存
parent
acc6c6af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
3 deletions
+66
-3
MainScene.ts
egret/src/mainScene/MainScene.ts
+66
-3
No files found.
egret/src/mainScene/MainScene.ts
View file @
c38b861d
...
...
@@ -394,7 +394,22 @@ export default class MainScene extends Scene {
//铺草坪
turfingArr
:
Array
<
number
>
=
[]
turfingArr
:
Array
<
number
>
=
[];
//当前已有草的格子
//一次掉落前的消除集合
recoverArr
:
Array
<
{
turidx
:
number
,
main
:
Array
<
{
idx
:
number
,
canturff
:
boolean
,
canturft
:
boolean
,
}
>
,
all
:
Array
<
{
idx
:
number
,
canturff
:
boolean
,
canturft
:
boolean
}
>
}
>
=
[];
constructor
(){
super
();
window
[
'gm'
]
=
this
.
gm
;
...
...
@@ -2034,8 +2049,7 @@ export default class MainScene extends Scene {
bubble
:
true
,
};
this
.
turfingArr
=
new
Array
();
this
.
initTurf
();
}
//横向消除,不包括炮台石头
getEliHorPassCannoStone
(
row
:
number
,
col
:
number
){
...
...
@@ -2901,6 +2915,8 @@ export default class MainScene extends Scene {
this
.
eliminate
(
pcannostatArr
);
},
200
)
}
else
{
//TODO检测铺草,简单起见可以直接把本次小组铺的重新铺一便
//新大炮充能
for
(
var
np
=
0
;
np
<
pcannostatArr
.
length
;
np
++
){
if
(
this
.
readyCannoArr
.
indexOf
(
np
)
==-
1
&&
this
.
fireteamCannoArr
.
indexOf
(
np
)
==-
1
){
...
...
@@ -2953,6 +2969,7 @@ export default class MainScene extends Scene {
* 掉落完后的操作
*/
async
fallCallback
()
{
this
.
initTurf
();
this
.
incheckFall
=
true
;
// //掉落后先走猩猩的消除
// if(this.gopongoArr.length>0){//消除猩猩,先播放猩猩消失的动画,后消除
...
...
@@ -6170,4 +6187,50 @@ export default class MainScene extends Scene {
this
.
turfEliHorPassCp
(
row
,
col
,
turfCp
);
this
.
turfEliVerPassCp
(
row
,
col
,
turfCp
);
}
//铺草在一次掉落前,不分先后顺序
initTurf
(){
// this.turfingArr = new Array();
this
.
recoverArr
=
new
Array
();
}
/**
*
* idx---格子坐标
* canturff----能否铺出去
* canturft----能够被铺上
*
*/
solveTurf
(
turfidx
:
number
,
main
:
Array
<
{
idx
:
number
,
canturff
:
boolean
,
canturft
:
boolean
}
>
,
all
:
Array
<
{
idx
:
number
,
canturff
:
boolean
,
canturft
:
boolean
}
>
){
var
canturff
=
false
;
for
(
var
i1
=
0
;
i1
<
main
.
length
;
i1
++
){
var
i1data
=
main
[
i1
];
if
(
i1data
.
canturff
){
canturff
=
true
;
break
;
}
}
var
oldneedturfarr
:
Array
<
number
>
=
new
Array
();
if
(
canturff
){
for
(
var
i2
=
0
;
i2
<
all
.
length
;
i2
++
){
var
i2data
=
all
[
i2
];
if
(
!
i2data
.
canturft
){
oldneedturfarr
.
push
(
i2data
.
idx
);
}
}
}
var
zhijepuArr
:
Array
<
number
>
=
new
Array
();
var
freshpuArr
:
Array
<
number
>
=
new
Array
();
for
(
var
i3
=
0
;
i3
<
this
.
recoverArr
.
length
;
i3
++
){
var
i3data
=
this
.
recoverArr
[
i3
];
var
i3idx
=
i3data
.
turidx
;
var
i3main
=
i3data
.
main
;
var
i3all
=
i3data
.
all
;
}
}
}
\ No newline at end of file
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