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
f5d267ab
Commit
f5d267ab
authored
Mar 06, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突home.json
parents
1910cf58
555fbe04
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
167 additions
and
13 deletions
+167
-13
MainBase.ts
egret/libs/new_wx/MainBase.ts
+1
-0
arrowbg.png
egret/resource/assets/mainScene/arrowbg.png
+0
-0
default.res.json
egret/resource/default.res.json
+9
-0
MainScene.ts
egret/src/mainScene/MainScene.ts
+26
-0
Chapter1.ts
egret/src/something/chapters/Chapter1.ts
+21
-12
conveyorTool.ts
egret/src/something/conveyor/conveyorTool.ts
+100
-0
createArrowBg.ts
egret/src/something/conveyor/createArrowBg.ts
+8
-0
ChapterData.ts
egret/src/something/interface/ChapterData.ts
+0
-1
MapData.ts
egret/src/something/interface/MapData.ts
+2
-0
No files found.
egret/libs/new_wx/MainBase.ts
View file @
f5d267ab
...
@@ -426,6 +426,7 @@ export default class MainBase extends eui.UILayer {
...
@@ -426,6 +426,7 @@ export default class MainBase extends eui.UILayer {
"monster_shoot"
,
"monster_shoot"
,
"ele33_1"
,
"ele33_1"
,
"ele33_0"
,
"ele33_0"
,
"arrowbg"
,
]
]
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
RES
.
getResAsync
(
arr
[
i
]
+
"_png"
)
RES
.
getResAsync
(
arr
[
i
]
+
"_png"
)
...
...
egret/resource/assets/mainScene/arrowbg.png
0 → 100644
View file @
f5d267ab
5.76 KB
egret/resource/default.res.json
View file @
f5d267ab
...
@@ -239,6 +239,10 @@
...
@@ -239,6 +239,10 @@
{
{
"keys"
:
"eleDisNew4_9_png,eleDisNew4_8_png,eleDisNew4_7_png,eleDisNew4_6_png,eleDisNew4_5_png,eleDisNew4_4_png,eleDisNew4_3_png,eleDisNew4_2_png,eleDisNew4_14_png,eleDisNew4_13_png,eleDisNew4_12_png,eleDisNew4_11_png,eleDisNew4_10_png,eleDisNew4_1_png,eleDisNew4_0_png,eleDisNew3_9_png,eleDisNew3_8_png,eleDisNew3_7_png,eleDisNew3_6_png,eleDisNew3_5_png,eleDisNew3_4_png,eleDisNew3_3_png,eleDisNew3_2_png,eleDisNew3_14_png,eleDisNew3_13_png,eleDisNew3_12_png,eleDisNew3_11_png,eleDisNew3_10_png,eleDisNew3_1_png,eleDisNew3_0_png,eleDisNew2_9_png,eleDisNew2_8_png,eleDisNew2_7_png,eleDisNew2_6_png,eleDisNew2_5_png,eleDisNew2_4_png,eleDisNew2_3_png,eleDisNew2_2_png,eleDisNew2_14_png,eleDisNew2_13_png,eleDisNew2_12_png,eleDisNew2_11_png,eleDisNew2_10_png,eleDisNew2_1_png,eleDisNew2_0_png,eleDisNew1_9_png,eleDisNew1_8_png,eleDisNew1_7_png,eleDisNew1_6_png,eleDisNew1_5_png,eleDisNew1_4_png,eleDisNew1_3_png,eleDisNew1_2_png,eleDisNew1_14_png,eleDisNew1_13_png,eleDisNew1_12_png,eleDisNew1_11_png,eleDisNew1_10_png,eleDisNew1_1_png,eleDisNew1_0_png,eleDisNew0_9_png,eleDisNew0_8_png,eleDisNew0_7_png,eleDisNew0_6_png,eleDisNew0_5_png,eleDisNew0_4_png,eleDisNew0_3_png,eleDisNew0_2_png,eleDisNew0_14_png,eleDisNew0_13_png,eleDisNew0_12_png,eleDisNew0_11_png,eleDisNew0_10_png,eleDisNew0_1_png,eleDisNew0_0_png"
,
"keys"
:
"eleDisNew4_9_png,eleDisNew4_8_png,eleDisNew4_7_png,eleDisNew4_6_png,eleDisNew4_5_png,eleDisNew4_4_png,eleDisNew4_3_png,eleDisNew4_2_png,eleDisNew4_14_png,eleDisNew4_13_png,eleDisNew4_12_png,eleDisNew4_11_png,eleDisNew4_10_png,eleDisNew4_1_png,eleDisNew4_0_png,eleDisNew3_9_png,eleDisNew3_8_png,eleDisNew3_7_png,eleDisNew3_6_png,eleDisNew3_5_png,eleDisNew3_4_png,eleDisNew3_3_png,eleDisNew3_2_png,eleDisNew3_14_png,eleDisNew3_13_png,eleDisNew3_12_png,eleDisNew3_11_png,eleDisNew3_10_png,eleDisNew3_1_png,eleDisNew3_0_png,eleDisNew2_9_png,eleDisNew2_8_png,eleDisNew2_7_png,eleDisNew2_6_png,eleDisNew2_5_png,eleDisNew2_4_png,eleDisNew2_3_png,eleDisNew2_2_png,eleDisNew2_14_png,eleDisNew2_13_png,eleDisNew2_12_png,eleDisNew2_11_png,eleDisNew2_10_png,eleDisNew2_1_png,eleDisNew2_0_png,eleDisNew1_9_png,eleDisNew1_8_png,eleDisNew1_7_png,eleDisNew1_6_png,eleDisNew1_5_png,eleDisNew1_4_png,eleDisNew1_3_png,eleDisNew1_2_png,eleDisNew1_14_png,eleDisNew1_13_png,eleDisNew1_12_png,eleDisNew1_11_png,eleDisNew1_10_png,eleDisNew1_1_png,eleDisNew1_0_png,eleDisNew0_9_png,eleDisNew0_8_png,eleDisNew0_7_png,eleDisNew0_6_png,eleDisNew0_5_png,eleDisNew0_4_png,eleDisNew0_3_png,eleDisNew0_2_png,eleDisNew0_14_png,eleDisNew0_13_png,eleDisNew0_12_png,eleDisNew0_11_png,eleDisNew0_10_png,eleDisNew0_1_png,eleDisNew0_0_png"
,
"name"
:
"eleDisNew"
"name"
:
"eleDisNew"
},
{
"name"
:
"preload"
,
"keys"
:
"arrowbg_png"
}
}
],
],
"resources"
:
[
"resources"
:
[
...
@@ -4937,6 +4941,11 @@
...
@@ -4937,6 +4941,11 @@
"url"
:
"assets/eleDisNew/eleDisNew4_14.png"
,
"url"
:
"assets/eleDisNew/eleDisNew4_14.png"
,
"type"
:
"image"
,
"type"
:
"image"
,
"name"
:
"eleDisNew4_14_png"
"name"
:
"eleDisNew4_14_png"
},
{
"name"
:
"arrowbg_png"
,
"type"
:
"image"
,
"url"
:
"assets/mainScene/arrowbg.png"
}
}
]
]
}
}
\ No newline at end of file
egret/src/mainScene/MainScene.ts
View file @
f5d267ab
...
@@ -102,6 +102,8 @@ import Sand, { getSandDisplayBlock } from '../something/Sand';
...
@@ -102,6 +102,8 @@ import Sand, { getSandDisplayBlock } from '../something/Sand';
import
{
SandAni
}
from
'../something/anis/SandAni'
;
import
{
SandAni
}
from
'../something/anis/SandAni'
;
import
doSandAI
from
'./doSandAI'
;
import
doSandAI
from
'./doSandAI'
;
import
{
createSandDisAni
}
from
'../effect/createSandDisAni'
;
import
{
createSandDisAni
}
from
'../effect/createSandDisAni'
;
import
{
getArrowDir
,
getArrowRotation
,
fillConveyor
}
from
'../something/conveyor/conveyorTool'
;
import
createArrowBg
from
'../something/conveyor/createArrowBg'
;
const
aniClass
=
{
const
aniClass
=
{
"BoomAni"
:
BoomAni
,
"BoomAni"
:
BoomAni
,
...
@@ -198,6 +200,7 @@ export default class MainScene extends Scene {
...
@@ -198,6 +200,7 @@ export default class MainScene extends Scene {
eliminatedElements
:
number
[]
=
[];
eliminatedElements
:
number
[]
=
[];
//棒棒糖生成标志
//棒棒糖生成标志
lollipopMark
:
boolean
;
lollipopMark
:
boolean
;
conveyor
:
egret
.
DisplayObjectContainer
;
//地图背景容器
//地图背景容器
map
:
egret
.
DisplayObjectContainer
;
map
:
egret
.
DisplayObjectContainer
;
//是否手动触发特效,用于两个组合后的特效
//是否手动触发特效,用于两个组合后的特效
...
@@ -322,6 +325,7 @@ export default class MainScene extends Scene {
...
@@ -322,6 +325,7 @@ export default class MainScene extends Scene {
NetManager
.
ins
.
showLog
(
getlogItem
(
10
))
NetManager
.
ins
.
showLog
(
getlogItem
(
10
))
NetManager
.
ins
.
showLog
(
getlogItem
(
13
))
NetManager
.
ins
.
showLog
(
getlogItem
(
13
))
this
.
initConveyor
();
//初始话地图格子数据
//初始话地图格子数据
this
.
initLattices
();
this
.
initLattices
();
//初始化回收口,如果是棒棒糖关卡,那么在地图底部增加棒棒糖洞,用到map
//初始化回收口,如果是棒棒糖关卡,那么在地图底部增加棒棒糖洞,用到map
...
@@ -453,7 +457,10 @@ export default class MainScene extends Scene {
...
@@ -453,7 +457,10 @@ export default class MainScene extends Scene {
var
path
=
generateMapBg
(
this
.
chapterData
.
map
.
lattices
);
var
path
=
generateMapBg
(
this
.
chapterData
.
map
.
lattices
);
var
bg
=
drawBg
(
path
,
this
.
chapterData
.
map
.
lattices
)
var
bg
=
drawBg
(
path
,
this
.
chapterData
.
map
.
lattices
)
this
.
addChild
(
bg
);
this
.
addChild
(
bg
);
const
conveyor
=
new
egret
.
Sprite
();
this
.
conveyor
=
conveyor
;
this
.
map
=
bg
;
this
.
map
=
bg
;
this
.
map
.
addChild
(
conveyor
);
//容器
//容器
this
.
elementContainer
=
new
egret
.
DisplayObjectContainer
();
this
.
elementContainer
=
new
egret
.
DisplayObjectContainer
();
this
.
addChild
(
this
.
elementContainer
);
this
.
addChild
(
this
.
elementContainer
);
...
@@ -598,6 +605,25 @@ export default class MainScene extends Scene {
...
@@ -598,6 +605,25 @@ export default class MainScene extends Scene {
}
}
}
}
initConveyor
()
{
const
conveyorList
=
this
.
chapterData
.
map
.
conveyor
;
if
(
!
conveyorList
)
return
;
const
tex
=
RES
.
getRes
(
'arrowbg_png'
);
for
(
const
conveyor
of
conveyorList
)
{
const
dir
=
getArrowDir
(
conveyor
);
const
list
=
fillConveyor
(
conveyor
);
list
.
forEach
(
i
=>
{
const
arrow
=
createArrowBg
(
tex
);
arrow
.
rotation
=
getArrowRotation
(
dir
);
this
.
conveyor
.
addChild
(
arrow
);
const
p
=
Tool
.
getPositionByIndex
(
i
);
arrow
.
x
=
p
[
0
];
arrow
.
y
=
p
[
1
];
// egret.Tween.get(arrow).to({y:p[1]+500},7000)
});
}
}
//初始化地图格子数据,包括生成口,联通口
//初始化地图格子数据,包括生成口,联通口
initLattices
()
{
initLattices
()
{
var
latticesD
=
this
.
chapterData
.
map
.
lattices
;
var
latticesD
=
this
.
chapterData
.
map
.
lattices
;
...
...
egret/src/something/chapters/Chapter1.ts
View file @
f5d267ab
...
@@ -10,15 +10,15 @@ export const Chapters1: ChapterData[] = [
...
@@ -10,15 +10,15 @@ export const Chapters1: ChapterData[] = [
null
,
null
,
//1引导基本消除
//1引导基本消除
{
{
baseElementTypes
:
[
0
,
1
,
2
,
3
],
baseElementTypes
:
[
0
,
1
,
2
,
3
,
4
],
bubbleProbability
:
0
,
bubbleProbability
:
0
,
stepCount
:
25
,
stepCount
:
999
,
passTarget
:
{
passTarget
:
{
type
:
PassType
.
ELEMENT_TARGET
,
type
:
PassType
.
ELEMENT_TARGET
,
elements
:
[
elements
:
[
{
{
type
:
ElementType
.
CHICKEN
,
type
:
ElementType
.
CHICKEN
,
count
:
4
5
,
count
:
99
5
,
},
},
],
],
},
},
...
@@ -35,11 +35,20 @@ export const Chapters1: ChapterData[] = [
...
@@ -35,11 +35,20 @@ export const Chapters1: ChapterData[] = [
0
,
0
,
0
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
],
],
conveyor
:[
[
20
,
56
],
[
57
,
60
],
[
51
,
24
],
// [23,20],
],
conveyorConnectedLats
:[
[
76
,
29
]
],
generateLats
:
[
generateLats
:
[
{
index
:
11
,
type
:
[
0
],
cus
:
[]
},
{
index
:
11
,
type
:
[
0
],
cus
:
[]
},
{
index
:
15
,
type
:
[
0
],
cus
:
[]
},
{
index
:
15
,
type
:
[
0
],
cus
:
[]
},
],
],
// connectedLats: [[0, 18], [1, 19], [2, 20
]],
connectedLats
:
[[
76
,
11
]],
elements
:
[
elements
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
0
,
0
,
...
@@ -53,14 +62,14 @@ export const Chapters1: ChapterData[] = [
...
@@ -53,14 +62,14 @@ export const Chapters1: ChapterData[] = [
],
],
baseElements
:
[
baseElements
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
20
,
0
,
0
,
0
,
2
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
20
,
10
,
20
,
0
,
20
,
10
,
2
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
20
,
10
,
20
,
10
,
20
,
10
,
20
,
10
,
2
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
20
,
10
,
20
,
20
,
10
,
20
,
20
,
10
,
2
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
20
,
10
,
20
,
10
,
20
,
10
,
2
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
20
,
10
,
20
,
10
,
2
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
20
,
10
,
2
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
2
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
],
],
// recycles: [70, 71, 72, 73]
// recycles: [70, 71, 72, 73]
},
},
...
...
egret/src/something/conveyor/conveyorTool.ts
0 → 100644
View file @
f5d267ab
import
{
Tool
}
from
"../Tool"
;
export
const
getArrowDir
=
(
conveyor
:
number
[])
=>
{
const
[
conveyor1
,
conveyor2
]
=
conveyor
;
if
(
conveyor1
==
conveyor2
)
throw
new
Error
(
'配置错误:conveyor1 == conveyor2'
);
let
r
;
if
(
conveyor2
>
conveyor1
)
{
//向右或者下
const
[
r1
,
c1
]
=
Tool
.
indexToRc
(
conveyor1
);
const
[
r2
,
c2
]
=
Tool
.
indexToRc
(
conveyor2
);
if
(
c1
==
c2
)
//向下
r
=
ARROW_DIR
.
DOWN
;
else
if
(
r1
==
r2
)
//向右
r
=
ARROW_DIR
.
RIGHT
else
throw
new
Error
(
'配置错误:conveyor1和conveyor2必须在一行或者一列'
);
}
else
{
//向左或者上
const
[
r1
,
c1
]
=
Tool
.
indexToRc
(
conveyor1
);
const
[
r2
,
c2
]
=
Tool
.
indexToRc
(
conveyor2
);
if
(
c1
==
c2
)
//向上
r
=
ARROW_DIR
.
UP
;
else
if
(
r1
==
r2
)
//向左
r
=
ARROW_DIR
.
LEFT
else
throw
new
Error
(
'配置错误:conveyor1和conveyor2必须在一行或者一列'
);
}
return
r
;
}
export
const
ARROW_DIR
=
{
LEFT
:
'LEFT'
,
RIGHT
:
'RIGHT'
,
UP
:
'UP'
,
DOWN
:
'DOWN'
}
export
const
getArrowRotation
=
(
dir
)
=>
{
switch
(
dir
)
{
case
ARROW_DIR
.
LEFT
:
return
180
case
ARROW_DIR
.
RIGHT
:
return
0
case
ARROW_DIR
.
UP
:
return
-
90
case
ARROW_DIR
.
DOWN
:
return
90
}
return
null
}
const
fillConveyor1
=
(
conveyor
:
number
[])
=>
{
const
[
conveyor1
,
conveyor2
]
=
conveyor
;
const
result
=
[];
for
(
let
index
=
conveyor2
;
index
<=
conveyor1
;
index
++
)
{
result
.
push
(
index
);
}
return
result
;
}
const
fillConveyor2
=
(
conveyor
:
number
[])
=>
{
const
[
conveyor1
,
conveyor2
]
=
conveyor
;
const
result
=
[];
for
(
let
index
=
conveyor1
;
index
<=
conveyor2
;
index
++
)
{
result
.
push
(
index
);
}
return
result
;
}
const
fillConveyor3
=
(
conveyor
:
number
[])
=>
{
const
[
conveyor1
,
conveyor2
]
=
conveyor
;
//up
const
[
r1
,
c1
]
=
Tool
.
indexToRc
(
conveyor1
);
const
[
r2
,
c2
]
=
Tool
.
indexToRc
(
conveyor2
);
const
result
=
[];
for
(
let
index
=
r2
;
index
<=
r1
;
index
++
)
{
result
.
push
(
Tool
.
rcToIndex
(
index
,
c1
));
}
return
result
;
}
const
fillConveyor4
=
(
conveyor
:
number
[])
=>
{
const
[
conveyor1
,
conveyor2
]
=
conveyor
;
//down
const
[
r1
,
c1
]
=
Tool
.
indexToRc
(
conveyor1
);
const
[
r2
,
c2
]
=
Tool
.
indexToRc
(
conveyor2
);
const
result
=
[];
for
(
let
index
=
r1
;
index
<=
r2
;
index
++
)
{
result
.
push
(
Tool
.
rcToIndex
(
index
,
c1
));
}
return
result
;
}
export
const
fillConveyor
=
(
conveyor
:
number
[])
=>
{
const
dir
=
getArrowDir
(
conveyor
);
switch
(
dir
)
{
case
ARROW_DIR
.
LEFT
:
return
fillConveyor1
(
conveyor
)
case
ARROW_DIR
.
RIGHT
:
return
fillConveyor2
(
conveyor
)
case
ARROW_DIR
.
UP
:
return
fillConveyor3
(
conveyor
)
case
ARROW_DIR
.
DOWN
:
return
fillConveyor4
(
conveyor
)
}
return
null
;
}
\ No newline at end of file
egret/src/something/conveyor/createArrowBg.ts
0 → 100644
View file @
f5d267ab
export
default
(
tex
)
=>
{
const
container
=
new
egret
.
Sprite
();
const
arrow
=
new
egret
.
Bitmap
(
tex
);
arrow
.
anchorOffsetX
=
arrow
.
width
/
2
;
arrow
.
anchorOffsetY
=
arrow
.
height
/
2
;
container
.
addChild
(
arrow
);
return
container
;
}
\ No newline at end of file
egret/src/something/interface/ChapterData.ts
View file @
f5d267ab
...
@@ -33,5 +33,4 @@ export interface ChapterData {
...
@@ -33,5 +33,4 @@ export interface ChapterData {
* 星数对应的分数,数组长度为3
* 星数对应的分数,数组长度为3
*/
*/
starScores
:
number
[];
starScores
:
number
[];
}
}
\ No newline at end of file
egret/src/something/interface/MapData.ts
View file @
f5d267ab
...
@@ -6,6 +6,8 @@ import { LatticeType } from "../enum/LatticeType";
...
@@ -6,6 +6,8 @@ import { LatticeType } from "../enum/LatticeType";
* 包括地图格子,和地图上的特殊元素,生成口,联通口
* 包括地图格子,和地图上的特殊元素,生成口,联通口
*/
*/
export
interface
MapData
{
export
interface
MapData
{
conveyor
?:
number
[][];
conveyorConnectedLats
?:
number
[][];
/**
/**
* 一维格子数组,步长9
* 一维格子数组,步长9
*
*
...
...
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