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
f83bc4f4
Commit
f83bc4f4
authored
Oct 25, 2019
by
邱旭
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://gitlab2.dui88.com/wanghongyuan/xiaoxiaole
into dev
parents
af18de97
ad23ece5
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
684 additions
and
182 deletions
+684
-182
GameGuide.ts
egret/src/mainScene/GameGuide.ts
+15
-12
MainScene.ts
egret/src/mainScene/MainScene.ts
+135
-123
Chapter1.ts
egret/src/something/chapters/Chapter1.ts
+271
-27
Chapter2.ts
egret/src/something/chapters/Chapter2.ts
+232
-8
getChapter.ts
egret/src/something/chapters/getChapter.ts
+1
-1
ChapterData.ts
egret/src/something/interface/ChapterData.ts
+5
-2
MapData.ts
egret/src/something/interface/MapData.ts
+1
-1
AiControl.ts
egret/src/something/logic/AiControl.ts
+24
-8
No files found.
egret/src/mainScene/GameGuide.ts
View file @
f83bc4f4
...
...
@@ -53,15 +53,14 @@ export class GameGuide extends egret.DisplayObjectContainer {
show
()
{
var
step
=
this
.
stepAll
-
this
.
stepCount
;
this
.
drawBg
(
step
);
//修改元素的层级,置顶,否则可能点击其他元素
var
data
=
chapterFuns
[
this
.
thisObj
.
chapter
];
for
(
var
i
=
0
;
i
<
data
.
showIndexs
[
step
]
.
length
;
i
++
)
{
var
index
=
data
.
showIndexs
[
step
]
[
i
];
//修改元素的层级,置顶,否则可能点击其他元素
,handIndexs
var
handIndexs
=
chapterFuns
[
this
.
thisObj
.
chapter
].
handIndexs
[
step
];
for
(
var
i
=
0
;
i
<
handIndexs
.
length
;
i
++
)
{
var
index
=
handIndexs
[
i
];
var
lat
=
this
.
thisObj
.
lattices
[
index
]
if
(
lat
&&
lat
.
element
)
this
.
thisObj
.
elementContainer
.
addChild
(
lat
.
element
);
}
var
handIndexs
=
chapterFuns
[
this
.
thisObj
.
chapter
].
handIndexs
[
step
];
this
.
handAni
(
handIndexs
);
this
.
msg
.
text
=
chapterFuns
[
this
.
thisObj
.
chapter
].
msg
[
step
]
||
""
;
this
.
msg
.
x
=
(
750
-
this
.
msg
.
textWidth
)
/
2
;
...
...
@@ -88,7 +87,7 @@ export class GameGuide extends egret.DisplayObjectContainer {
}
}
private
handAni
(
handIndexs
:
number
)
{
private
handAni
(
handIndexs
:
number
[]
)
{
egret
.
Tween
.
removeTweens
(
this
.
hand
)
var
p1
=
Tool
.
getPositionByIndex
(
handIndexs
[
0
]);
var
p2
=
Tool
.
getPositionByIndex
(
handIndexs
[
1
]);
...
...
@@ -274,19 +273,23 @@ const chapterFuns = {
]
},
//棒棒糖消除
1
00
:
{
stepCount
:
1
,
1
7
:
{
stepCount
:
2
,
showIndexs
:
[
[
4
,
5
,
6
,
13
],
[
22
,
31
,
40
,
49
,
39
],
[
68
,
49
,
58
,
67
,
76
],
],
hideIndexs
:
[
[
5
,
6
],
[
22
,
31
,
49
],
[
49
,
58
,
76
],
],
handIndexs
:
[
[
13
,
4
]
[
39
,
40
],
[
68
,
67
],
],
msg
:
[
"当棒棒糖移至底层时,即可移除棒棒糖"
"当棒棒糖移至底层时,即可移除棒棒糖"
,
"消除棒棒糖下方的动物
\n
就可以收集棒棒糖啦"
]
},
//笼子消除
...
...
egret/src/mainScene/MainScene.ts
View file @
f83bc4f4
This diff is collapsed.
Click to expand it.
egret/src/something/chapters/Chapter1.ts
View file @
f83bc4f4
This diff is collapsed.
Click to expand it.
egret/src/something/chapters/Chapter2.ts
View file @
f83bc4f4
...
...
@@ -8,31 +8,255 @@ import { ElementType } from "../enum/ElementType";
export
const
Chapters2
:
ChapterData
[]
=
[
//21
{
baseElementTypes
:
[
0
,
1
,
2
,
4
],
bubbleProbability
:
0
,
stepCount
:
30
,
passTarget
:
{
type
:
PassType
.
ELEMENT_TARGET
,
elements
:
[
{
type
:
ElementType
.
ICE
,
count
:
56
},
]
},
starScores
:
[
4000
,
8000
,
12000
],
map
:
{
lattices
:
[
0
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
0
,
0
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
0
,
0
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
0
,
0
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
0
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
1
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
1
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
1
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
],
elements
:
[
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
2
,
1
,
1
,
1
,
1
,
1
,
2
,
0
,
0
,
2
,
1
,
1
,
1
,
1
,
1
,
2
,
0
,
0
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
0
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
0
,
0
,
0
,
2
,
2
,
2
,
0
,
0
,
0
,
0
,
0
,
0
,
2
,
2
,
2
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
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
,
],
generateLats
:
[
{
index
:
1
,
type
:
[
0
],
cus
:
[]
},
{
index
:
2
,
type
:
[
0
],
cus
:
[]
},
{
index
:
3
,
type
:
[
0
],
cus
:
[]
},
{
index
:
4
,
type
:
[
0
],
cus
:
[]
},
{
index
:
5
,
type
:
[
0
],
cus
:
[]
},
{
index
:
6
,
type
:
[
0
],
cus
:
[]
},
{
index
:
7
,
type
:
[
0
],
cus
:
[]
},
],
},
},
//22
{
baseElementTypes
:
[
0
,
1
,
2
,
3
],
bubbleProbability
:
0
,
stepCount
:
30
,
passTarget
:
{
type
:
PassType
.
ELEMENT_TARGET
,
elements
:
[
{
type
:
ElementType
.
ROCK
,
count
:
34
},
{
type
:
ElementType
.
CHICKEN
,
count
:
50
},
]
},
starScores
:
[
4000
,
8000
,
12000
],
map
:
{
lattices
:
[
0
,
0
,
1
,
0
,
1
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
],
elements
:
[
0
,
0
,
1
,
0
,
1
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
2
,
2
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
1
,
2
,
2
],
baseElements
:
[
0
,
0
,
31
,
0
,
24
,
0
,
31
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
20
,
31
,
20
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
20
,
0
,
0
,
0
,
0
,
2
,
2
,
30
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
30
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
30
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
30
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
30
,
2
,
2
],
generateLats
:
[
{
index
:
2
,
type
:
[
0
],
cus
:
[]
},
{
index
:
4
,
type
:
[
0
],
cus
:
[]
},
{
index
:
6
,
type
:
[
0
],
cus
:
[]
},
{
index
:
36
,
type
:
[
0
],
cus
:
[]
},
{
index
:
37
,
type
:
[
0
],
cus
:
[]
},
{
index
:
38
,
type
:
[
0
],
cus
:
[]
},
{
index
:
39
,
type
:
[
0
],
cus
:
[]
},
{
index
:
41
,
type
:
[
0
],
cus
:
[]
},
{
index
:
42
,
type
:
[
0
],
cus
:
[]
},
{
index
:
43
,
type
:
[
0
],
cus
:
[]
},
{
index
:
44
,
type
:
[
0
],
cus
:
[]
},
],
// generateLats: ,
connectedLats
:
[],
connectedLats
:
[[
2
,
21
],
[
4
,
22
],
[
6
,
23
]]
},
},
//23
{
baseElementTypes
:
[
0
,
1
,
2
,
3
,
4
],
bubbleProbability
:
0
,
stepCount
:
22
,
passTarget
:
{
type
:
PassType
.
ELEMENT_TARGET
,
elements
:
[
{
type
:
ElementType
.
LOLLIPOP
,
count
:
12
},
]
},
starScores
:
[
4000
,
8000
,
12000
],
map
:
{
lattices
:
[
0
,
0
,
1
,
0
,
1
,
0
,
1
,
0
,
0
,
0
,
0
,
1
,
0
,
1
,
0
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
],
elements
:
[
0
,
0
,
3
,
0
,
3
,
0
,
3
,
0
,
0
,
0
,
0
,
3
,
0
,
3
,
0
,
3
,
0
,
0
,
0
,
1
,
2
,
1
,
2
,
1
,
2
,
1
,
0
,
0
,
1
,
2
,
1
,
2
,
1
,
2
,
1
,
0
,
0
,
1
,
2
,
1
,
2
,
1
,
2
,
1
,
0
,
0
,
1
,
2
,
1
,
2
,
1
,
2
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
],
baseElements
:
[
0
,
0
,
3
,
0
,
3
,
0
,
3
,
0
,
0
,
0
,
0
,
3
,
0
,
3
,
0
,
3
,
0
,
0
,
0
,
10
,
2
,
30
,
2
,
20
,
2
,
10
,
0
,
0
,
30
,
2
,
30
,
2
,
20
,
2
,
10
,
0
,
0
,
20
,
2
,
20
,
2
,
10
,
2
,
30
,
0
,
0
,
10
,
2
,
20
,
2
,
10
,
2
,
20
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
40
,
40
,
50
,
40
,
50
,
40
,
50
,
40
,
40
,
0
,
50
,
40
,
50
,
40
,
50
,
40
,
50
,
0
,
],
generateLats
:
[
{
index
:
2
,
type
:
[
0
],
cus
:
[]
},
{
index
:
4
,
type
:
[
0
],
cus
:
[]
},
{
index
:
6
,
type
:
[
0
],
cus
:
[]
},
{
index
:
63
,
type
:
[
0
],
cus
:
[]
},
{
index
:
64
,
type
:
[
0
],
cus
:
[]
},
{
index
:
65
,
type
:
[
0
],
cus
:
[]
},
{
index
:
66
,
type
:
[
0
],
cus
:
[]
},
{
index
:
67
,
type
:
[
0
],
cus
:
[]
},
{
index
:
68
,
type
:
[
0
],
cus
:
[]
},
{
index
:
69
,
type
:
[
0
],
cus
:
[]
},
{
index
:
70
,
type
:
[
0
],
cus
:
[]
},
{
index
:
71
,
type
:
[
0
],
cus
:
[]
},
],
recycles
:
[
46
,
47
,
48
,
49
,
50
,
51
,
52
]
},
},
//24
{
baseElementTypes
:
[
0
,
1
,
2
,
3
,
4
],
effectInitProbability
:
0.1
,
stepCount
:
30
,
bubbleProbability
:
0
,
stepCount
:
27
,
passTarget
:
{
type
:
PassType
.
SCORE_TARGET
,
score
:
6000
,
type
:
PassType
.
ELEMENT_TARGET
,
elements
:
[
{
type
:
ElementType
.
ICE
,
count
:
31
},
]
},
starScores
:
[
4000
,
8000
,
12000
],
map
:
{
lattices
:
[
2
,
0
,
2
,
2
,
1
,
0
,
3
,
3
,
3
,
2
,
0
,
0
,
0
,
0
,
0
,
3
,
3
,
3
,
0
,
0
,
0
,
0
,
0
,
0
,
3
,
3
,
3
,
0
,
0
,
1
,
1
,
1
,
0
,
3
,
3
,
3
,
0
,
0
,
1
,
1
,
1
,
0
,
3
,
3
,
3
,
0
,
0
,
1
,
1
,
1
,
0
,
3
,
3
,
3
,
0
,
0
,
1
,
1
,
1
,
0
,
3
,
3
,
3
,
0
,
0
,
1
,
1
,
1
,
0
,
3
,
3
,
3
,
0
,
0
,
1
,
1
,
1
,
0
,
3
,
3
,
3
,
],
elements
:
[
1
,
0
,
2
,
2
,
2
,
0
,
2
,
0
,
2
,
1
,
0
,
0
,
0
,
0
,
0
,
2
,
0
,
2
,
0
,
0
,
0
,
0
,
0
,
0
,
2
,
0
,
2
,
0
,
0
,
2
,
2
,
2
,
0
,
2
,
0
,
2
,
0
,
0
,
2
,
2
,
2
,
0
,
0
,
2
,
0
,
0
,
0
,
2
,
2
,
2
,
0
,
2
,
0
,
2
,
0
,
0
,
2
,
2
,
2
,
0
,
2
,
0
,
2
,
0
,
0
,
2
,
2
,
2
,
0
,
2
,
0
,
2
,
0
,
0
,
2
,
2
,
2
,
0
,
2
,
0
,
2
,
],
baseElements
:
[
11
,
0
,
2
,
2
,
2
,
0
,
2
,
0
,
2
,
23
,
0
,
0
,
0
,
0
,
0
,
2
,
0
,
2
,
0
,
0
,
0
,
0
,
0
,
0
,
2
,
0
,
2
,
0
,
0
,
2
,
2
,
2
,
0
,
2
,
0
,
2
,
0
,
0
,
2
,
2
,
2
,
0
,
0
,
2
,
0
,
0
,
0
,
2
,
2
,
2
,
0
,
2
,
0
,
2
,
0
,
0
,
2
,
2
,
2
,
0
,
2
,
0
,
2
,
0
,
0
,
2
,
2
,
2
,
0
,
2
,
0
,
2
,
0
,
0
,
2
,
2
,
2
,
0
,
2
,
0
,
2
,
],
generateLats
:
[
{
index
:
0
,
type
:
[
0
],
cus
:
[]
},
{
index
:
2
,
type
:
[
0
],
cus
:
[
33
]
},
{
index
:
3
,
type
:
[
0
],
cus
:
[
21
]
},
{
index
:
4
,
type
:
[
0
],
cus
:
[]
},
],
connectedLats
:
[[
2
,
29
],
[
3
,
30
],
[
4
,
31
],
[
74
,
6
],
[
75
,
7
],
[
76
,
8
]]
},
starScores
:
[
2000
,
4000
,
6000
]
},
]
\ No newline at end of file
egret/src/something/chapters/getChapter.ts
View file @
f83bc4f4
...
...
@@ -5,7 +5,7 @@ import { ChapterData } from "../interface/ChapterData";
//所有的关卡
const
chapters
:
ChapterData
[]
=
[].
concat
(
Chapters1
,
//
Chapters2,
Chapters2
,
)
/**
* 获取关卡数据,返回关卡数据
...
...
egret/src/something/interface/ChapterData.ts
View file @
f83bc4f4
...
...
@@ -4,6 +4,8 @@ import { ElementType } from "../enum/ElementType";
/**
* 关卡数据接口
* ,,注意有些带数组的数据,避免被修改,需要用slice克隆操作
* 比如基础元素类型,定制掉落数组
*/
export
interface
ChapterData
{
/**
...
...
@@ -12,12 +14,13 @@ export interface ChapterData {
map
:
MapData
;
/**
* 基础元素数量3-5,种类是否随机
* 基础类型和ElementType一致 0到4
*/
baseElementTypes
:
ElementType
[];
/**
*
初始特效生成几率5-20%
*
气泡生成概率0到1
*/
effectInitProbability
:
number
;
bubbleProbability
?
:
number
;
/**
* 总步数
*/
...
...
egret/src/something/interface/MapData.ts
View file @
f83bc4f4
...
...
@@ -56,7 +56,7 @@ export interface MapData {
/**
* 棒棒糖回收口
*
*
格子索引
*/
recycles
?:
number
[];
}
\ No newline at end of file
egret/src/something/logic/AiControl.ts
View file @
f83bc4f4
...
...
@@ -9,6 +9,7 @@ import { ChickenEgg } from "../class/ChickenEgg";
import
{
HatchAni
}
from
"../anis/HatchAni"
;
import
{
PieceToEggAni
}
from
"../anis/PieceToEggAni"
;
import
{
StateType
}
from
"../enum/StateType"
;
import
{
BubbleAni
}
from
"../anis/BubbleAni"
;
//孵鸡的数量
const
chickenNum
:
number
=
4
...
...
@@ -38,7 +39,7 @@ export class AiControl {
/**
* 用于判断格子中
* 是否有果冻,
* 是否有鸡蛋,
* 是否有鸡蛋,
所有带鸡蛋的格子的索引
* 是否有毛球,
* 是否有变色气泡,
* 必须在初始化元素后执行,每关进入游戏都会初始化
...
...
@@ -223,9 +224,12 @@ export class AiControl {
indexs
.
push
(
i
);
}
}
//没有气泡,直接回调,
if
(
!
indexs
.
length
)
{
//标记无气泡
this
.
hasBubble
=
false
;
callback
();
return
}
let
count
=
0
;
let
countAll
=
indexs
.
length
;
...
...
@@ -234,16 +238,26 @@ export class AiControl {
let
index
=
indexs
[
a
];
let
lat
=
thisObj
.
lattices
[
index
];
let
ele
=
lat
.
element
;
let
fromType
=
ele
.
type
;
//计算type
let
type
:
ElementType
=
1
;
//直接重置类型,为了后续计算,但是要隐藏,待动画播放完显示
ele
.
resetType
(
type
);
ele
.
visible
=
false
;
///重写
ele
.
getState
(
StateType
.
BUBBLE
).
play
(
type
,
()
=>
{
//播完重置类型
ele
.
resetType
(
type
)
//变色动画
let
bubbleAni
:
BubbleAni
=
Pool
.
takeOut
(
RecoverName
.
JELLYSPREAD_ANI
)
if
(
!
bubbleAni
)
{
bubbleAni
=
new
BubbleAni
()
}
//位置信息
var
p
=
Tool
.
getPositionByIndex
(
index
);
bubbleAni
.
x
=
p
[
0
];
bubbleAni
.
y
=
p
[
1
];
thisObj
.
addChild
(
bubbleAni
);
//播放动画
bubbleAni
.
play
(
fromType
,
type
,
()
=>
{
//显示
ele
.
visible
=
true
;
count
++
;
if
(
count
==
countAll
)
{
callback
();
...
...
@@ -339,6 +353,8 @@ function judgeSpread(index: number, lattices: Lattice[]): number {
return
null
}
// function getBubble
...
...
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