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
e9bcbca9
Commit
e9bcbca9
authored
Mar 10, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
799b7543
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
366 additions
and
94 deletions
+366
-94
MainScene.ts
egret/src/mainScene/MainScene.ts
+2
-5
doConveyorAI.ts
egret/src/mainScene/doConveyorAI.ts
+27
-20
Chapter20.ts
egret/src/something/chapters/Chapter20.ts
+8
-4
xxx.ts
egret/src/something/chapters/xxx.ts
+0
-65
xxxx.ts
egret/src/something/chapters/xxxx.ts
+74
-0
Lattice.ts
egret/src/something/class/Lattice.ts
+5
-0
home.json
mock/happyclear/home.json
+125
-0
homemax.json
mock/happyclear/homemax.json
+125
-0
No files found.
egret/src/mainScene/MainScene.ts
View file @
e9bcbca9
...
...
@@ -610,7 +610,7 @@ export default class MainScene extends Scene {
initConveyor
()
{
const
conveyorList
=
this
.
chapterData
.
map
.
conveyor
;
if
(
!
conveyorList
)
return
;
if
(
!
conveyorList
)
return
;
const
tex
=
RES
.
getRes
(
'arrowbg_png'
);
for
(
const
conveyor
of
conveyorList
)
{
const
dir
=
getArrowDir
(
conveyor
);
...
...
@@ -620,10 +620,9 @@ export default class MainScene extends Scene {
arrow
.
rotation
=
getArrowRotation
(
dir
);
this
.
conveyor
.
addChild
(
arrow
);
const
p
=
Tool
.
getPositionByIndex
(
i
);
this
.
conveyorMap
[
i
]
=
arrow
;
this
.
conveyorMap
[
i
]
=
arrow
;
arrow
.
x
=
p
[
0
];
arrow
.
y
=
p
[
1
];
// egret.Tween.get(arrow).to({y:p[1]+500},7000)
});
}
}
...
...
@@ -2058,8 +2057,6 @@ export default class MainScene extends Scene {
}
await
doConveyorAI
(
this
);
await
doSandAI
(
this
);
if
(
this
.
lattices
.
some
(
lat
=>!
lat
.
element
))
throw
new
Error
(
'123'
)
const
doHoneyPotAIResult
=
await
doHoneyPotAI
(
this
);
if
(
doHoneyPotAIResult
.
length
>
0
)
{
//如果有激活的罐子被消除,那么表示可以自动消除,则不需要进行下一步
doHoneyPotAIResult
.
forEach
((
index
)
=>
{
...
...
egret/src/mainScene/doConveyorAI.ts
View file @
e9bcbca9
import
{
ARROW_DIR
,
fillConveyor
,
findTarget
,
getArrowDir
}
from
"../something/conveyor/conveyorTool"
;
import
MainScene
from
"./MainScene"
;
import
{
Tool
}
from
"../something/Tool"
;
import
{
Lattice
}
from
"../something/class/Lattice"
;
const
getTargetIndexs
=
(
conveyor
:
number
[])
=>
{
const
dir
=
getArrowDir
(
conveyor
);
...
...
@@ -10,23 +11,44 @@ const getTargetIndexs = (conveyor: number[]) => {
}
else
if
(
dir
==
ARROW_DIR
.
LEFT
||
dir
==
ARROW_DIR
.
UP
)
{
list
.
unshift
(
list
.
pop
());
}
return
list
;
}
let
conveyorAniList
:
{
[
key
:
string
]:
ConveyorAni
;
}
=
null
;
//单个皮带转动动效
class
ConveyorAni
{
private
orign
:
any
[];
private
list
:
any
[];
private
views
:
any
[]
=
[]
constructor
(
conveyor
)
{
this
.
list
=
fillConveyor
(
conveyor
);
this
.
orign
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
list
));
this
.
views
=
this
.
list
;
}
play
()
{
}
}
export
default
async
(
thisObj
:
MainScene
)
=>
{
//
移动了传送带之后,可能会有可消除的,需要检查消除
//
加上传送带的动画
//移动的动画,如果是两头的需要一个带遮罩的动画
//检查与其他元素的兼容性
const
conveyorList
=
thisObj
.
chapterData
.
map
.
conveyor
;
if
(
!
conveyorList
)
return
;
const
elementsList
=
[];
//所有轨道元素组的列表
const
targetLatticesList
=
[];
//所有轨道目标地图组的列表
const
targetLatticesList
:
Lattice
[][]
=
[];
//所有轨道目标地图组的列表
const
latticesList
=
[];
//所有轨道当前地图组的列表
const
targetIndexsList
=
[];
let
listItems
=
[];
if
(
!
conveyorAniList
)
conveyorAniList
=
{};
for
(
const
conveyor
of
conveyorList
)
{
const
list
=
fillConveyor
(
conveyor
);
listItems
=
listItems
.
concat
(
list
);
const
targetIndexs
=
getTargetIndexs
(
conveyor
);
conveyorAniList
[
conveyor
.
toString
()]
=
new
ConveyorAni
(
conveyor
);
const
dir
=
getArrowDir
(
conveyor
);
let
foundTarget
:
number
;
...
...
@@ -47,21 +69,8 @@ export default async (thisObj: MainScene) => {
targetLatticesList
.
push
(
targetLattices
);
latticesList
.
push
(
lattices
);
targetIndexsList
.
push
(
targetIndexs
);
// lattices.forEach(lat => lat.element = null);
// list.forEach((index, i) => {
// const c = thisObj.conveyorMap[index];
// const targetP = Tool.getPositionByIndex(targetIndexs[i]);
// egret.Tween.get(c).to({ x: targetP[0], y: targetP[1] }, 200);
// });
// elements.forEach((ele, i) => {
// targetLattices[i].element = ele;
// const targetP = Tool.getPositionByIndex(targetIndexs[i]);
// egret.Tween.get(ele).to({ x: targetP[0], y: targetP[1] }, 200);
}
listItems
.
forEach
(
item
=>
thisObj
.
conveyorMap
[
item
]
=
null
);
latticesList
.
forEach
(
lattices
=>
{
lattices
.
forEach
(
lat
=>
lat
.
element
=
null
);
});
...
...
@@ -75,11 +84,9 @@ export default async (thisObj: MainScene) => {
elements
.
forEach
((
ele
,
eleIndex
)
=>
{
targetLattices
[
eleIndex
].
element
=
ele
;
const
targetP
=
Tool
.
getPositionByIndex
(
targetIndexs
[
eleIndex
]);
const
promise
=
new
Promise
((
r
)
=>
{
egret
.
Tween
.
get
(
ele
).
to
({
x
:
targetP
[
0
],
y
:
targetP
[
1
]
},
5
00
).
call
(
r
);
egret
.
Tween
.
get
(
ele
).
to
({
x
:
targetP
[
0
],
y
:
targetP
[
1
]
},
2
00
).
call
(
r
);
});
promiseList
.
push
(
promise
)
});
});
...
...
egret/src/something/chapters/Chapter20.ts
View file @
e9bcbca9
...
...
@@ -31,15 +31,19 @@ export const Chapters20: ChapterData[] = [
],
conveyor
:
[
// [29,56],
// [57,60],
// [51, 33],
[
29
,
56
],
[
57
,
60
],
[
51
,
33
],
[
32
,
30
],
],
conveyorConnectedLats
:
[
// [56,57],
// [60,29],
// [56,51],
// [33,29],
[
56
,
57
],
[
60
,
51
],
[
33
,
32
],
[
30
,
51
],
[
30
,
29
],
],
generateLats
:
[
{
index
:
11
,
type
:
[
0
],
cus
:
[]
},
...
...
egret/src/something/chapters/xxx.ts
deleted
100755 → 0
View file @
799b7543
import
{
ChapterData
}
from
"../interface/ChapterData"
;
import
{
PassType
}
from
"../enum/PassType"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
//451-471
export
const
Chapters18
:
ChapterData
[]
=
[
{
baseElementTypes
:
[
0
,
1
,
2
,
3
],
bubbleProbability
:
0
,
stepCount
:
25
,
passTarget
:
{
type
:
PassType
.
ELEMENT_TARGET
,
elements
:
[
{
type
:
ElementType
.
CHICKEN
,
count
:
45
,
},
],
},
starScores
:
[
1000
,
5000
,
10000
],
map
:
{
lattices
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
],
generateLats
:
[
{
index
:
11
,
type
:
[
0
],
cus
:
[]
},
{
index
:
15
,
type
:
[
0
],
cus
:
[]
},
],
// connectedLats: [[0, 18], [1, 19], [2, 20]],
elements
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
],
baseElements
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
20
,
0
,
0
,
0
,
20
,
0
,
0
,
0
,
20
,
10
,
20
,
0
,
20
,
10
,
20
,
0
,
20
,
10
,
20
,
10
,
20
,
10
,
20
,
10
,
20
,
20
,
10
,
20
,
20
,
10
,
20
,
20
,
10
,
20
,
0
,
20
,
10
,
20
,
10
,
20
,
10
,
20
,
0
,
0
,
0
,
20
,
10
,
20
,
10
,
20
,
0
,
0
,
0
,
0
,
0
,
20
,
10
,
20
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
20
,
0
,
0
,
0
,
0
,
],
// recycles: [70, 71, 72, 73]
},
}
]
\ No newline at end of file
egret/src/something/chapters/xxxx.ts
0 → 100644
View file @
e9bcbca9
import
{
ChapterData
}
from
"../interface/ChapterData"
;
import
{
PassType
}
from
"../enum/PassType"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
//501-525
export
const
Chapters20
:
ChapterData
[]
=
[
{
baseElementTypes
:
[
0
,
1
,
2
,
3
,
4
],
bubbleProbability
:
0
,
stepCount
:
999
,
passTarget
:
{
type
:
PassType
.
ELEMENT_TARGET
,
elements
:
[
{
type
:
ElementType
.
CHICKEN
,
count
:
995
,
},
],
},
starScores
:
[
1000
,
5000
,
10000
],
map
:
{
lattices
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
],
conveyor
:
[
[
29
,
56
],
[
57
,
60
],
[
51
,
33
],
[
32
,
30
],
],
conveyorConnectedLats
:
[
[
56
,
57
],
[
60
,
51
],
[
33
,
32
],
[
30
,
29
],
],
generateLats
:
[
{
index
:
11
,
type
:
[
0
],
cus
:
[]
},
{
index
:
15
,
type
:
[
0
],
cus
:
[]
},
],
// connectedLats: [[76, 11]],
elements
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
],
baseElements
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
],
// recycles: [70, 71, 72, 73]
},
}
]
\ No newline at end of file
egret/src/something/class/Lattice.ts
View file @
e9bcbca9
...
...
@@ -27,6 +27,11 @@ export class Lattice {
get
element
():
Element
{
return
this
.
_element
}
private
_conveyor
;
get
conveyor
()
{
return
this
.
_conveyor
}
/**
* value为null或元素
*/
...
...
mock/happyclear/home.json
View file @
e9bcbca9
...
...
@@ -2513,6 +2513,131 @@
"levelNum"
:
500
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
501
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
502
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
503
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
504
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
505
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
506
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
507
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
508
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
509
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
510
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
511
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
512
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
513
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
514
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
515
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
516
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
517
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
518
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
519
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
520
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
521
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
522
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
523
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
524
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
525
,
"maxScore"
:
47440
,
"stars"
:
1
}
],
...
...
mock/happyclear/homemax.json
View file @
e9bcbca9
...
...
@@ -2513,6 +2513,131 @@
"levelNum"
:
500
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
501
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
502
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
503
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
504
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
505
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
506
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
507
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
508
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
509
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
510
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
511
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
512
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
513
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
514
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
515
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
516
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
517
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
518
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
519
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
520
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
521
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
522
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
523
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
524
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
525
,
"maxScore"
:
47440
,
"stars"
:
1
}
],
...
...
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