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
5de9a8d7
Commit
5de9a8d7
authored
May 06, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整铺草时机,添加无藤曼猩猩部位特效铺草
parent
2e1423fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
1 deletion
+43
-1
MainScene.ts
egret/src/mainScene/MainScene.ts
+34
-0
doFishAI.ts
egret/src/mainScene/doFishAI.ts
+9
-1
No files found.
egret/src/mainScene/MainScene.ts
View file @
5de9a8d7
...
...
@@ -2036,6 +2036,9 @@ export default class MainScene extends Scene {
jellymo
:
true
,
bubble
:
true
,
};
this
.
turfingArr
=
new
Array
();
}
//横向消除,不包括炮台石头
getEliHorPassCannoStone
(
row
:
number
,
col
:
number
){
...
...
@@ -4224,6 +4227,8 @@ export default class MainScene extends Scene {
let
ele
=
lat
.
element
;
if
(
!
ele
)
continue
;
var
p
=
Tool
.
getPositionByIndex
(
index
);
var
canturgrass
=
Tool
.
judgeTurfing
(
lat
);
var
grassArr
=
new
Array
();
switch
(
ele
.
effectType
)
{
case
EffectType
.
MAGICLION
:
if
(
sounds
.
indexOf
(
SoundType
.
magic
)
==
-
1
)
sounds
.
push
(
SoundType
.
magic
)
...
...
@@ -4257,7 +4262,11 @@ export default class MainScene extends Scene {
this
.
lattices
[
i
].
element
.
effectType
!=
EffectType
.
MAGICLION
&&
//不是魔力鸟
this
.
lattices
[
i
].
element
.
type
==
type
//类型相等
)
{
if
(
this
.
eliminatedElements
.
indexOf
(
i
)
<
0
&&
effectIndexs
.
indexOf
(
i
)
<
0
)
{
if
(
canturgrass
&&
Tool
.
judgeTurfto
(
this
.
lattices
[
i
])){
grassArr
.
push
(
i
);
}
this
.
eliminatedElements
.
push
(
i
);
//无特效未枷锁,无毛球的参与旋转
if
(
Tool
.
judgeMagicRotate
(
this
.
lattices
[
i
].
element
))
{
...
...
@@ -4290,6 +4299,9 @@ export default class MainScene extends Scene {
if
(
Tool
.
judgeEliminate
(
this
.
lattices
[
i
])
&&
(
Math
.
abs
(
this
.
lattices
[
i
].
row
-
lat
.
row
)
<
2
&&
Math
.
abs
(
this
.
lattices
[
i
].
column
-
lat
.
column
)
<
2
))
{
if
(
this
.
eliminatedElements
.
indexOf
(
i
)
<
0
&&
effectIndexs
.
indexOf
(
i
)
<
0
)
{
if
(
canturgrass
&&
Tool
.
judgeTurfto
(
this
.
lattices
[
i
])){
grassArr
.
push
(
i
);
}
this
.
eliminatedElements
.
push
(
i
);
if
(
this
.
lattices
[
i
].
element
.
type
==
ElementType
.
FISH
)
{
this
.
lattices
[
i
].
element
.
nextFishState
();
...
...
@@ -4337,6 +4349,9 @@ export default class MainScene extends Scene {
var
jelidx
=
elimitarr
[
j1
];
var
jlat
=
this
.
lattices
[
jelidx
];
if
(
this
.
eliminatedElements
.
indexOf
(
jelidx
)
==-
1
&&
effectIndexs
.
indexOf
(
jelidx
)
==-
1
){
if
(
canturgrass
&&
Tool
.
judgeTurfto
(
jlat
)){
grassArr
.
push
(
jelidx
);
}
this
.
eliminatedElements
.
push
(
jelidx
);
if
(
jlat
.
element
.
type
==
ElementType
.
FISH
){
jlat
.
element
.
nextFishState
();
...
...
@@ -4393,6 +4408,9 @@ export default class MainScene extends Scene {
var
jelidx
=
elimitarr
[
j1
];
var
jlat
=
this
.
lattices
[
jelidx
];
if
(
this
.
eliminatedElements
.
indexOf
(
jelidx
)
==-
1
&&
effectIndexs
.
indexOf
(
jelidx
)
==-
1
){
if
(
canturgrass
&&
Tool
.
judgeTurfto
(
jlat
)){
grassArr
.
push
(
jelidx
);
}
this
.
eliminatedElements
.
push
(
jelidx
);
if
(
jlat
.
element
.
type
==
ElementType
.
FISH
){
jlat
.
element
.
nextFishState
();
...
...
@@ -4416,6 +4434,8 @@ export default class MainScene extends Scene {
break
;
}
this
.
changeGroGrass
(
grassArr
);
}
//播放音乐
for
(
var
a
=
0
;
a
<
sounds
.
length
;
a
++
)
{
...
...
@@ -5127,6 +5147,7 @@ export default class MainScene extends Scene {
}
// console.log("所有可作为左上角的",canusearr,"\n所有位置",allusearr);
var
grassArr
=
new
Array
();
//原来9*9
while
(
kuangarr
.
length
<
4
){
var
randkidx
=
Math
.
floor
(
Math
.
random
()
*
canusearr
.
length
);
...
...
@@ -5169,11 +5190,13 @@ export default class MainScene extends Scene {
if
(
allhave
&&
haveele
){
//所占框都可用
var
igrassarr
=
new
Array
();
for
(
var
k3
=
0
;
k3
<
kuangidxarr
.
length
;
k3
++
){
var
k3kuangidx
=
kuangidxarr
[
k3
];
var
ellat
=
this
.
lattices
[
k3kuangidx
];
if
(
ellat
&&
Tool
.
judgeEliminate
(
ellat
)){
igrassarr
.
push
(
k3kuangidx
);
if
(
this
.
eliminatedElements
.
indexOf
(
k3kuangidx
)
==-
1
){
this
.
eliminatedElements
.
push
(
k3kuangidx
);
}
...
...
@@ -5194,6 +5217,7 @@ export default class MainScene extends Scene {
canusearr
.
splice
(
k3caninuse
,
1
);
}
}
grassArr
.
push
(
igrassarr
);
kuangarr
.
push
(
k1idx
);
}
}
...
...
@@ -5232,6 +5256,8 @@ export default class MainScene extends Scene {
}.
bind
(
this
));
}
}
this
.
checkTurfing
(
grassArr
);
}
playCompleteJio
(
e
){
// console.log("猩猩脚印播放完毕");
...
...
@@ -5902,4 +5928,12 @@ export default class MainScene extends Scene {
// }
}
}
//判断草坪能否蔓延
judgeTurfing
(
idx
:
number
){
if
(
this
.
turfingArr
.
indexOf
(
idx
)
!=-
1
){
return
true
;
}
return
Tool
.
judgeTurfing
(
this
.
lattices
[
idx
]);
}
}
\ No newline at end of file
egret/src/mainScene/doFishAI.ts
View file @
5de9a8d7
...
...
@@ -19,22 +19,30 @@ export default async (thisObj: MainScene) => {
thisObj
.
eliminatedElements
.
push
(
lattice
.
index
);
}
}
for
(
const
index
of
indexs
)
{
const
lat
:
Lattice
=
thisObj
.
lattices
[
index
];
let
canturgrass
=
Tool
.
judgeTurfing
(
lat
);
let
grassArr
=
new
Array
();
lat
.
element
[
'fish'
].
toExplose
();
// wait(1000).then(()=>{
const
p
=
Tool
.
getPositionByIndex
(
index
);
var
boomAni
=
thisObj
.
playAni
(
RecoverName
.
BOOM_ANI
,
p
);
boomAni
.
scaleX
=
boomAni
.
scaleY
=
1
;
// });
// });
for
(
var
i
=
0
;
i
<
thisObj
.
lattices
.
length
;
i
++
)
{
if
(
Tool
.
judgeEliminate
(
thisObj
.
lattices
[
i
])
&&
(
Math
.
abs
(
thisObj
.
lattices
[
i
].
row
-
lat
.
row
)
<
2
&&
Math
.
abs
(
thisObj
.
lattices
[
i
].
column
-
lat
.
column
)
<
2
))
{
if
(
thisObj
.
eliminatedElements
.
indexOf
(
thisObj
.
lattices
[
i
].
index
)
<
0
)
{
if
(
canturgrass
&&
Tool
.
judgeTurfto
(
thisObj
.
lattices
[
i
])){
grassArr
.
push
(
i
);
}
thisObj
.
eliminatedElements
.
push
(
thisObj
.
lattices
[
i
].
index
);
}
}
}
thisObj
.
changeGroGrass
(
grassArr
);
}
await
wait
(
500
);
...
...
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