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
e071b49f
Commit
e071b49f
authored
May 08, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
铺草暂存
parent
53c5c73d
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
543 additions
and
270 deletions
+543
-270
default.res.json
egret/resource/default.res.json
+7
-2
MainScene.ts
egret/src/mainScene/MainScene.ts
+505
-244
doFishAI.ts
egret/src/mainScene/doFishAI.ts
+27
-20
Tool.ts
egret/src/something/Tool.ts
+4
-4
No files found.
egret/resource/default.res.json
View file @
e071b49f
...
...
@@ -5398,9 +5398,14 @@
"name"
:
"wormhole_png"
},
{
"
name"
:
"startscenebg_
jpg"
,
"
url"
:
"assets/startscenebg.
jpg"
,
"type"
:
"image"
,
"url"
:
"assets/startscenebg.jpg"
"name"
:
"startscenebg_jpg"
},
{
"url"
:
"assets/mainScene/ele41.png"
,
"type"
:
"image"
,
"name"
:
"ele41_png"
}
]
}
\ No newline at end of file
egret/src/mainScene/MainScene.ts
View file @
e071b49f
This diff is collapsed.
Click to expand it.
egret/src/mainScene/doFishAI.ts
View file @
e071b49f
...
...
@@ -23,9 +23,12 @@ export default async (thisObj: MainScene) => {
for
(
const
index
of
indexs
)
{
const
lat
:
Lattice
=
thisObj
.
lattices
[
index
];
let
canturgrass
=
thisObj
.
judgeTurfing
(
index
);
let
grassArr
=
new
Array
();
var
turfCp
=
new
Array
();
// let canturgrass = thisObj.judgeTurfing(index);
// let grassArr = new Array();
// var turfCp = new Array();
var
mainidxs
:
Array
<
number
>
=
new
Array
();
var
allidxs
:
Array
<
number
>
=
new
Array
();
mainidxs
.
push
(
index
);
lat
.
element
[
'fish'
].
toExplose
();
// wait(1000).then(()=>{
const
p
=
Tool
.
getPositionByIndex
(
index
);
...
...
@@ -33,31 +36,35 @@ export default async (thisObj: MainScene) => {
boomAni
.
scaleX
=
boomAni
.
scaleY
=
1
;
// });
for
(
var
i
=
0
;
i
<
thisObj
.
lattices
.
length
;
i
++
)
{
if
(
canturgrass
&&
thisObj
.
lattices
[
i
]
&&
Math
.
abs
(
thisObj
.
lattices
[
i
].
row
-
lat
.
row
)
<
2
&&
Math
.
abs
(
thisObj
.
lattices
[
i
].
column
-
lat
.
column
)
<
2
){
if
(
lat
&&
lat
.
element
){
if
(
lat
.
element
.
type
==
ElementType
.
CANNO
&&!
lat
.
grass
){
turfCp
.
push
(
i
);
}
else
if
(
lat
.
element
.
type
==
ElementType
.
Pongo
&&!
lat
.
element
.
hasState
(
StateType
.
PongoLockState
)
&&!
lat
.
grass
){
turfCp
.
push
(
i
);
}
}
// if(canturgrass&&thisObj.lattices[i]&&Math.abs(thisObj.lattices[i].row - lat.row) < 2 && Math.abs(thisObj.lattices[i].column - lat.column) < 2){
// if(lat&&lat.element){
// if(lat.element.type==ElementType.CANNO&&!lat.grass){
// turfCp.push(i);
// }else if(lat.element.type==ElementType.Pongo&&!lat.element.hasState(StateType.PongoLockState)&&!lat.grass){
// turfCp.push(i);
// }
// }
// }
if
(
thisObj
.
lattices
[
i
]
&&
Math
.
abs
(
thisObj
.
lattices
[
i
].
row
-
lat
.
row
)
<
2
&&
Math
.
abs
(
thisObj
.
lattices
[
i
].
column
-
lat
.
column
)
<
2
){
allidxs
.
push
(
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
);
}
//
if(canturgrass&&Tool.judgeTurfto(thisObj.lattices[i])){
//
grassArr.push(i);
//
}
thisObj
.
eliminatedElements
.
push
(
thisObj
.
lattices
[
i
].
index
);
}
}
}
if
(
grassArr
.
length
>
0
){
thisObj
.
changeGroGrass
(
grassArr
);
}
if
(
turfCp
.
length
>
0
){
thisObj
.
changeGroGrassCp
(
turfCp
);
}
thisObj
.
addNewTurf
(
mainidxs
,
allidxs
);
// if(grassArr.length>0){
// thisObj.changeGroGrass(grassArr);
// }
// if(turfCp.length>0){
// thisObj.changeGroGrassCp(turfCp);
// }
}
await
wait
(
500
);
...
...
egret/src/something/Tool.ts
View file @
e071b49f
...
...
@@ -1336,9 +1336,9 @@ export class Tool {
let
ele
=
lat
.
element
;
let
canChosen
=
this
.
judgeChosen
(
ele
);
if
(
!
canChosen
){
if
(
ele
.
type
==
ElementType
.
CANNO
){
if
(
ele
.
type
==
ElementType
.
CANNO
&&
lat
.
grass
){
return
true
;
}
else
if
(
ele
.
type
==
ElementType
.
Pongo
&&!
ele
.
hasState
(
StateType
.
PongoLockState
)){
}
else
if
(
ele
.
type
==
ElementType
.
Pongo
&&!
ele
.
hasState
(
StateType
.
PongoLockState
)
&&
lat
.
grass
){
return
true
;
}
// console.log("铺出去55555555555555");
...
...
@@ -1367,9 +1367,9 @@ export class Tool {
let
ele
=
lat
.
element
;
let
canChosen
=
this
.
judgeChosen
(
ele
);
if
(
!
canChosen
){
if
(
ele
.
type
==
ElementType
.
CANNO
){
if
(
ele
.
type
==
ElementType
.
CANNO
&&!
lat
.
grass
){
return
true
;
}
else
if
(
ele
.
type
==
ElementType
.
Pongo
&&!
ele
.
hasState
(
StateType
.
PongoLockState
)){
}
else
if
(
ele
.
type
==
ElementType
.
Pongo
&&!
ele
.
hasState
(
StateType
.
PongoLockState
)
&&!
lat
.
grass
){
return
true
;
}
return
false
;
...
...
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