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
dd80c5fb
Commit
dd80c5fb
authored
Mar 27, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hotfix20200330_' into dev
parents
4150daa9
8a5ee75a
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
720 additions
and
96 deletions
+720
-96
index.html
egret/index.html
+1
-1
MainBase.ts
egret/libs/new_wx/MainBase.ts
+2
-0
ele38.png
egret/resource/assets/mainScene/ele38.png
+0
-0
ele39.png
egret/resource/assets/mainScene/ele39.png
+0
-0
canno.svga
egret/resource/assets/svgas/canno.svga
+0
-0
cannofire.svga
egret/resource/assets/svgas/cannofire.svga
+0
-0
cannolight.svga
egret/resource/assets/svgas/cannolight.svga
+0
-0
cannoparticle.svga
egret/resource/assets/svgas/cannoparticle.svga
+0
-0
loading_animals.svga
egret/resource/assets/svgas/loading_animals.svga
+0
-0
MainScene.ts
egret/src/mainScene/MainScene.ts
+353
-56
doSandAI.ts
egret/src/mainScene/doSandAI.ts
+1
-1
Tool.ts
egret/src/something/Tool.ts
+79
-7
Chapter22.ts
egret/src/something/chapters/Chapter22.ts
+92
-0
getChapter.ts
egret/src/something/chapters/getChapter.ts
+1
-1
Element.ts
egret/src/something/class/Element.ts
+137
-2
ElementConfigType.ts
egret/src/something/enum/ElementConfigType.ts
+7
-0
ElementType.ts
egret/src/something/enum/ElementType.ts
+42
-27
MapData.ts
egret/src/something/interface/MapData.ts
+5
-1
No files found.
egret/index.html
View file @
dd80c5fb
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
background-color
:
#000
;
background-color
:
#000
;
background-size
:
100%
;
background-size
:
100%
;
background-position
:
center
;
background-position
:
center
;
background-image
:
url("https://yun.duiba.com.cn/db_games/activity/game/0
217/startscenebg2
.jpg")
;
background-image
:
url("https://yun.duiba.com.cn/db_games/activity/game/0
327/startscenebg
.jpg")
;
/* background-image: url("https://yun.duiba.com.cn/db_games/activity/game/1565600901/resource/assets/startScene/startscenebg.jpg"); */
/* background-image: url("https://yun.duiba.com.cn/db_games/activity/game/1565600901/resource/assets/startScene/startscenebg.jpg"); */
padding
:
0
;
padding
:
0
;
border
:
0
;
border
:
0
;
...
...
egret/libs/new_wx/MainBase.ts
View file @
dd80c5fb
...
@@ -307,6 +307,8 @@ export default class MainBase extends eui.UILayer {
...
@@ -307,6 +307,8 @@ export default class MainBase extends eui.UILayer {
}
}
RES
.
getResAsync
(
"ele34_png"
);
RES
.
getResAsync
(
"ele34_png"
);
RES
.
getResAsync
(
"ele36_png"
);
RES
.
getResAsync
(
"ele36_png"
);
RES
.
getResAsync
(
"ele38_png"
);
RES
.
getResAsync
(
"ele39_png"
);
for
(
var
i
=
1
;
i
<=
27
;
i
++
)
{
for
(
var
i
=
1
;
i
<=
27
;
i
++
)
{
RES
.
getResAsync
(
"bonusFra"
+
i
+
"_png"
)
RES
.
getResAsync
(
"bonusFra"
+
i
+
"_png"
)
}
}
...
...
egret/resource/assets/mainScene/ele38.png
0 → 100644
View file @
dd80c5fb
3.24 KB
egret/resource/assets/mainScene/ele39.png
0 → 100644
View file @
dd80c5fb
2.37 KB
egret/resource/assets/svgas/canno.svga
0 → 100644
View file @
dd80c5fb
File added
egret/resource/assets/svgas/cannofire.svga
0 → 100644
View file @
dd80c5fb
File added
egret/resource/assets/svgas/cannolight.svga
0 → 100644
View file @
dd80c5fb
File added
egret/resource/assets/svgas/cannoparticle.svga
0 → 100644
View file @
dd80c5fb
File added
egret/resource/assets/svgas/loading_animals.svga
View file @
dd80c5fb
No preview for this file type
egret/src/mainScene/MainScene.ts
View file @
dd80c5fb
This diff is collapsed.
Click to expand it.
egret/src/mainScene/doSandAI.ts
View file @
dd80c5fb
...
@@ -16,7 +16,7 @@ export default async (thisObj: MainScene) => {
...
@@ -16,7 +16,7 @@ export default async (thisObj: MainScene) => {
const
sandLattices
=
thisObj
.
lattices
.
filter
(
lattice
=>
{
const
sandLattices
=
thisObj
.
lattices
.
filter
(
lattice
=>
{
return
lattice
.
sand
;
return
lattice
.
sand
;
});
});
console
.
log
(
sandLattices
);
//
console.log(sandLattices);
//map promise
//map promise
//先判断是否能跳动,目前都能跳
//先判断是否能跳动,目前都能跳
const
promiseList
:
Promise
<
any
>
[]
=
[];
const
promiseList
:
Promise
<
any
>
[]
=
[];
...
...
egret/src/something/Tool.ts
View file @
dd80c5fb
...
@@ -2,13 +2,14 @@ import { Element } from "./class/Element";
...
@@ -2,13 +2,14 @@ import { Element } from "./class/Element";
import
{
Lattice
}
from
"./class/Lattice"
;
import
{
Lattice
}
from
"./class/Lattice"
;
import
{
RectMask
}
from
"./class/RectMask"
;
import
{
RectMask
}
from
"./class/RectMask"
;
import
{
EffectType
}
from
"./enum/EffectType"
;
import
{
EffectType
}
from
"./enum/EffectType"
;
import
{
ElementType
,
FiveBaseElementTypes
}
from
"./enum/ElementType"
;
import
{
ElementType
,
FiveBaseElementTypes
,
forwardDirection
}
from
"./enum/ElementType"
;
import
{
RecoverName
}
from
"./enum/RecoverName"
;
import
{
RecoverName
}
from
"./enum/RecoverName"
;
import
{
StateType
}
from
"./enum/StateType"
;
import
{
StateType
}
from
"./enum/StateType"
;
import
{
FallType
}
from
"./interface/FallAniData"
;
import
{
FallType
}
from
"./interface/FallAniData"
;
import
{
GenerateLatData
}
from
"./interface/GenerateLatData"
;
import
{
GenerateLatData
}
from
"./interface/GenerateLatData"
;
import
{
Pool
}
from
"./Pool"
;
import
{
Pool
}
from
"./Pool"
;
import
HoneyPotElement
from
"./class/HoneyPotElement"
;
import
HoneyPotElement
from
"./class/HoneyPotElement"
;
import
{
ElementConfigType
}
from
"./enum/ElementConfigType"
;
//两种,0无棒棒糖,1有
//两种,0无棒棒糖,1有
const
offsetYTwo
:
number
[]
=
[];
const
offsetYTwo
:
number
[]
=
[];
...
@@ -230,6 +231,21 @@ export class Tool {
...
@@ -230,6 +231,21 @@ export class Tool {
}
}
return
false
return
false
}
}
/**
* 根据idx判断相邻
* @param a
* @param b
*/
public
static
checkNebByidx
(
a
:
number
,
b
:
number
){
var
arc
=
this
.
indexToRc
(
a
);
var
brc
=
this
.
indexToRc
(
b
);
if
(
Math
.
abs
(
arc
[
0
]
-
brc
[
0
])
==
1
&&
Math
.
abs
(
arc
[
1
]
-
brc
[
1
])
==
0
)
{
return
true
}
else
if
(
Math
.
abs
(
arc
[
0
]
-
brc
[
0
])
==
0
&&
Math
.
abs
(
arc
[
1
]
-
brc
[
1
])
==
1
)
{
return
true
}
return
false
}
/**
/**
* 数组中插入一个数值,按顺序的
* 数组中插入一个数值,按顺序的
...
@@ -281,8 +297,10 @@ export class Tool {
...
@@ -281,8 +297,10 @@ export class Tool {
lat
.
element
.
type
==
ElementType
.
JELLY_MONSTER
||
lat
.
element
.
type
==
ElementType
.
JELLY_MONSTER
||
lat
.
element
.
type
==
ElementType
.
FIREWORKS_SHOOTER
||
lat
.
element
.
type
==
ElementType
.
FIREWORKS_SHOOTER
||
lat
.
element
.
type
==
ElementType
.
CHICKEN_EGG
||
lat
.
element
.
type
==
ElementType
.
CHICKEN_EGG
||
lat
.
element
.
type
==
ElementType
.
FESTIVALELE_BIG
//
||
lat
.
element
.
type
==
ElementType
.
FESTIVALELE_BIG
||
// lat.element.type == ElementType.FESTIVALELE_SMALL
// lat.element.type == ElementType.FESTIVALELE_SMALL
lat
.
element
.
type
==
ElementType
.
CANNO
||
lat
.
element
.
type
==
ElementType
.
CANNO_BLOCK
)
{
)
{
return
false
return
false
}
}
...
@@ -344,7 +362,9 @@ export class Tool {
...
@@ -344,7 +362,9 @@ export class Tool {
//上方元素为冰淇淋
//上方元素为冰淇淋
else
if
(
lat
.
element
.
type
==
ElementType
.
LOLLIPOP
||
else
if
(
lat
.
element
.
type
==
ElementType
.
LOLLIPOP
||
lat
.
element
.
type
==
ElementType
.
JELLY_MONSTER
||
lat
.
element
.
type
==
ElementType
.
JELLY_MONSTER
||
lat
.
element
.
type
==
ElementType
.
FIREWORKS_SHOOTER
lat
.
element
.
type
==
ElementType
.
FIREWORKS_SHOOTER
||
lat
.
element
.
type
==
ElementType
.
CANNO
||
lat
.
element
.
type
==
ElementType
.
CANNO_BLOCK
)
{
)
{
return
false
return
false
}
}
...
@@ -353,6 +373,21 @@ export class Tool {
...
@@ -353,6 +373,21 @@ export class Tool {
return
true
return
true
}
}
}
}
/**
* 判断是否是炮台石头
* @param lat
*/
public
static
judgeIscannoBlock
(
lat
:
Lattice
){
if
(
!
lat
||!
lat
.
element
){
return
false
;
}
else
if
(
lat
.
element
.
type
==
ElementType
.
CANNO_BLOCK
){
return
true
;
}
else
{
return
false
;
}
}
/**
/**
* 判断格子上是基础元素,包括各种状态的
* 判断格子上是基础元素,包括各种状态的
...
@@ -428,7 +463,9 @@ export class Tool {
...
@@ -428,7 +463,9 @@ export class Tool {
ele
.
type
==
ElementType
.
FIREWORKS_SHOOTER
||
ele
.
type
==
ElementType
.
FIREWORKS_SHOOTER
||
ele
.
type
==
ElementType
.
CHICKEN_EGG
||
ele
.
type
==
ElementType
.
CHICKEN_EGG
||
ele
.
type
==
ElementType
.
FESTIVALELE_BIG
||
ele
.
type
==
ElementType
.
FESTIVALELE_BIG
||
ele
.
type
==
ElementType
.
FESTIVALELE_SMALL
ele
.
type
==
ElementType
.
FESTIVALELE_SMALL
||
ele
.
type
==
ElementType
.
CANNO
||
ele
.
type
==
ElementType
.
CANNO_BLOCK
)
{
)
{
return
false
;
return
false
;
}
}
...
@@ -454,7 +491,9 @@ export class Tool {
...
@@ -454,7 +491,9 @@ export class Tool {
ele
.
hasState
(
StateType
.
HAIRBALLGREY
)
||
ele
.
hasState
(
StateType
.
HAIRBALLGREY
)
||
ele
.
hasState
(
StateType
.
BLOCK_LOCK
)
||
ele
.
hasState
(
StateType
.
BLOCK_LOCK
)
||
ele
.
hasState
(
StateType
.
HAIRBALLBLACK
)
||
ele
.
hasState
(
StateType
.
HAIRBALLBLACK
)
||
ele
.
hasState
(
StateType
.
HAIRBALLBROWN
)
ele
.
hasState
(
StateType
.
HAIRBALLBROWN
)
||
ele
.
type
==
ElementType
.
CANNO
||
ele
.
type
==
ElementType
.
CANNO_BLOCK
)
{
)
{
return
false
;
return
false
;
}
}
...
@@ -474,7 +513,9 @@ export class Tool {
...
@@ -474,7 +513,9 @@ export class Tool {
ele
.
hasState
(
StateType
.
BLOCK_LOCK
)
||
ele
.
hasState
(
StateType
.
BLOCK_LOCK
)
||
ele
.
monster
||
ele
.
monster
||
ele
.
hasState
(
StateType
.
HAIRBALLBLACK
)
||
ele
.
hasState
(
StateType
.
HAIRBALLBLACK
)
||
ele
.
hasState
(
StateType
.
HAIRBALLBROWN
)
ele
.
hasState
(
StateType
.
HAIRBALLBROWN
)
||
ele
.
type
==
ElementType
.
CANNO
||
ele
.
type
==
ElementType
.
CANNO_BLOCK
)
{
)
{
return
false
;
return
false
;
}
}
...
@@ -860,7 +901,6 @@ export class Tool {
...
@@ -860,7 +901,6 @@ export class Tool {
}
}
return
Tool
.
randomT
(
arr
);
return
Tool
.
randomT
(
arr
);
}
}
/**
/**
* 根据关卡的地图数据generateLats
* 根据关卡的地图数据generateLats
*
*
...
@@ -1177,4 +1217,36 @@ export class Tool {
...
@@ -1177,4 +1217,36 @@ export class Tool {
}
}
return
outArr
return
outArr
}
}
/**
* 判断是否是炮台
* @param type
*/
public
static
IsCanno
(
type
:
ElementConfigType
){
if
(
type
==
ElementConfigType
.
CANNO_DIR_TOP
||
type
==
ElementConfigType
.
CANNO_DIR_BOTTOM
||
type
==
ElementConfigType
.
CANNO_DIR_LEFT
||
type
==
ElementConfigType
.
CANNO_DIR_RIGHT
){
return
true
;
}
return
false
;
}
public
static
getCannoDir
(
type
:
ElementConfigType
){
if
(
type
==
ElementConfigType
.
CANNO_DIR_TOP
){
return
forwardDirection
.
up
;
}
else
if
(
type
==
ElementConfigType
.
CANNO_DIR_BOTTOM
){
return
forwardDirection
.
down
;
}
else
if
(
type
==
ElementConfigType
.
CANNO_DIR_LEFT
){
return
forwardDirection
.
left
;
}
else
if
(
type
==
ElementConfigType
.
CANNO_DIR_RIGHT
){
return
forwardDirection
.
right
;
}
else
{
console
.
error
(
"未定义跑跳"
);
}
}
}
}
\ No newline at end of file
egret/src/something/chapters/Chapter22.ts
View file @
dd80c5fb
import
{
ChapterData
}
from
"../interface/ChapterData"
;
import
{
ChapterData
}
from
"../interface/ChapterData"
;
import
{
PassType
}
from
"../enum/PassType"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
//551-575
//551-575
export
const
Chapters22
:
ChapterData
[]
=
[
export
const
Chapters22
:
ChapterData
[]
=
[
//551
{
baseElementTypes
:
[
0
,
1
,
2
,
3
,
4
],
bubbleProbability
:
0
,
stepCount
:
35
,
passTarget
:
{
type
:
1
,
elements
:
[{
type
:
1
,
count
:
155
},
{
type
:
34
,
count
:
15
}]
},
starScores
:
[
15000
,
20000
,
25000
],
map
:
{
lattices
:
[
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
4
,
1
,
0
,
1
,
0
,
1
,
4
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
0
,
1
],
connectedLats
:
[],
conveyor
:
[
[
9
,
63
],
[
17
,
71
]
],
conveyorConnectedLats
:
[
[
63
,
9
],
[
71
,
17
]
],
elements
:
[
1
,
19
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
20
,
1
,
1
,
1
,
1
,
2
,
2
,
2
,
1
,
1
,
1
,
1
,
6
,
1
,
1
,
1
,
1
,
1
,
6
,
1
,
1
,
1
,
1
,
1
,
16
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
16
,
1
,
1
,
1
,
1
,
1
,
22
,
1
,
1
,
16
,
1
,
1
,
1
,
1
,
5
,
6
,
1
,
1
,
2
,
1
,
1
,
6
,
5
,
1
,
1
,
1
,
2
,
2
,
2
,
1
,
1
,
1
],
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
:
[],
generateLats
:
[{
index
:
0
,
type
:
null
},
{
index
:
1
,
type
:
null
},
{
index
:
2
,
type
:
null
},
{
index
:
3
,
type
:
null
},
{
index
:
4
,
type
:
null
},
{
index
:
5
,
type
:
null
},
{
index
:
6
,
type
:
null
},
{
index
:
7
,
type
:
null
},
{
index
:
8
,
type
:
null
}]
}
}
]
]
egret/src/something/chapters/getChapter.ts
View file @
dd80c5fb
...
@@ -69,7 +69,7 @@ chapters.forEach((chapter,index) => {
...
@@ -69,7 +69,7 @@ chapters.forEach((chapter,index) => {
*/
*/
export
function
getChapterData
(
index
:
number
):
ChapterData
{
export
function
getChapterData
(
index
:
number
):
ChapterData
{
//没有数据就返回第一关数据
//没有数据就返回第一关数据
return
chapters
[
index
]
||
chapters
[
1
];
return
chapters
[
index
]
||
chapters
[
55
1
];
}
}
var
a
=
{
var
a
=
{
...
...
egret/src/something/class/Element.ts
View file @
dd80c5fb
...
@@ -13,7 +13,7 @@ import { createCandyDis3Ani } from "../anis/candy/createCandyDis3Ani";
...
@@ -13,7 +13,7 @@ import { createCandyDis3Ani } from "../anis/candy/createCandyDis3Ani";
import
{
createCandyDis4Ani
}
from
"../anis/candy/createCandyDis4Ani"
;
import
{
createCandyDis4Ani
}
from
"../anis/candy/createCandyDis4Ani"
;
import
{
createCandySubAni
}
from
"../anis/candy/createCandySubAni"
;
import
{
createCandySubAni
}
from
"../anis/candy/createCandySubAni"
;
import
{
EffectType
}
from
"../enum/EffectType"
;
import
{
EffectType
}
from
"../enum/EffectType"
;
import
{
CandyBaseElementType
,
ElementType
,
FiveBaseElementTypes
,
transElementRes
}
from
"../enum/ElementType"
;
import
{
CandyBaseElementType
,
ElementType
,
FiveBaseElementTypes
,
transElementRes
,
forwardDirection
}
from
"../enum/ElementType"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
{
stateDatas
,
StateType
}
from
"../enum/StateType"
;
import
{
stateDatas
,
StateType
}
from
"../enum/StateType"
;
import
{
ExplosiveBgAni
}
from
"../periodAni/ExplosiveBgAni"
;
import
{
ExplosiveBgAni
}
from
"../periodAni/ExplosiveBgAni"
;
...
@@ -35,11 +35,18 @@ import { Fish } from "./Fish";
...
@@ -35,11 +35,18 @@ import { Fish } from "./Fish";
* 坐标原点需要坐落在格子的中心点
* 坐标原点需要坐落在格子的中心点
* 最好到时按,底图,动效,气泡,笼子,毛球,进行分层,如果多个状态要共存时,必须分层,到时气泡的动画,要写再自己的层里
* 最好到时按,底图,动效,气泡,笼子,毛球,进行分层,如果多个状态要共存时,必须分层,到时气泡的动画,要写再自己的层里
*/
*/
//加载器
let
svgaParser
;
export
class
Element
extends
eui
.
Component
{
export
class
Element
extends
eui
.
Component
{
private
_fishState
=
0
;
private
_fishState
=
0
;
private
_isNeb
:
boolean
;
//是否
private
_isNeb
:
boolean
;
//是否
get
isNeb
()
{
return
this
.
_isNeb
}
get
isNeb
()
{
return
this
.
_isNeb
}
fishCanEliFlag
:
boolean
;
fishCanEliFlag
:
boolean
;
cannoMoveClip
:
any
;
cannoStat
:
number
[]
=
[
1
,
61
,
121
,
181
,
241
,
361
];
//尝试设置碰撞状态,如果之前被特效集中,那么可以设置碰撞状态。碰撞状态之后可以准备消除。
//尝试设置碰撞状态,如果之前被特效集中,那么可以设置碰撞状态。碰撞状态之后可以准备消除。
setFishNebFlag
()
{
setFishNebFlag
()
{
if
(
this
.
_fishState
>
0
)
{
if
(
this
.
_fishState
>
0
)
{
...
@@ -188,6 +195,50 @@ export class Element extends eui.Component {
...
@@ -188,6 +195,50 @@ export class Element extends eui.Component {
this
.
addCandyStandbyAni
();
this
.
addCandyStandbyAni
();
}
}
_cannoDir
:
forwardDirection
;
private
_cannoStat
:
number
=
0
;
resetToCannoView
(
cannodir
:
forwardDirection
){
this
.
_cannoDir
=
cannodir
;
this
.
resetCannoStat
();
// this.showImage.x = 0;
// this.showImage.y = 0;
// this.showImage.anchorOffsetX = this.showImage.width / 2;
// this.showImage.anchorOffsetY = this.showImage.height / 2;
var
roaidx
:
number
;
if
(
cannodir
==
forwardDirection
.
left
){
roaidx
=
0
;
}
else
if
(
cannodir
==
forwardDirection
.
up
){
roaidx
=
1
;
}
else
if
(
cannodir
==
forwardDirection
.
right
){
roaidx
=
2
;
}
else
if
(
cannodir
==
forwardDirection
.
down
){
roaidx
=
3
;
}
this
.
cannobox
.
rotation
=
[
-
90
,
0
,
90
,
180
][
roaidx
];
}
changeShowCannoStat
(){
this
.
cannolab
.
text
=
this
.
_cannoStat
+
""
;
this
.
cannoMoveClip
&&
this
.
cannoMoveClip
.
gotoAndPlay
(
this
.
cannoStat
[
this
.
_cannoStat
]);
}
checkCannoStat
(){
if
(
this
.
_cannoStat
==
3
){
return
true
;
}
return
false
;
}
resetCannoStat
(){
this
.
_cannoStat
=
0
;
this
.
changeShowCannoStat
();
}
addOneCannoStat
(){
this
.
_cannoStat
+=
1
;
if
(
this
.
_cannoStat
>
3
){
this
.
_cannoStat
=
3
;
}
this
.
changeShowCannoStat
();
}
playCandyDieAni
()
{
playCandyDieAni
()
{
var
p
=
Tool
.
getPositionByIndex
(
this
.
index
);
var
p
=
Tool
.
getPositionByIndex
(
this
.
index
);
createCandyDieBgAni
(
p
[
0
],
p
[
1
],
this
.
stage
);
createCandyDieBgAni
(
p
[
0
],
p
[
1
],
this
.
stage
);
...
@@ -255,6 +306,9 @@ export class Element extends eui.Component {
...
@@ -255,6 +306,9 @@ export class Element extends eui.Component {
* 显示的图片,直接改source,"ele"+type
* 显示的图片,直接改source,"ele"+type
*/
*/
protected
showImage
:
eui
.
Image
;
protected
showImage
:
eui
.
Image
;
protected
cannobox
:
eui
.
Group
;
cannoboxwid
:
number
=
116
;
cannoboxhei
:
number
=
116
;
temEffectType
:
EffectType
=
null
;
temEffectType
:
EffectType
=
null
;
/**
/**
...
@@ -358,6 +412,8 @@ export class Element extends eui.Component {
...
@@ -358,6 +412,8 @@ export class Element extends eui.Component {
*/
*/
private
states
:
State
[]
=
[]
private
states
:
State
[]
=
[]
//模拟炮台发射情况
protected
cannolab
:
eui
.
Label
;
/**
/**
*
*
* @param type 只应该是基础元素和特殊元素
* @param type 只应该是基础元素和特殊元素
...
@@ -366,8 +422,28 @@ export class Element extends eui.Component {
...
@@ -366,8 +422,28 @@ export class Element extends eui.Component {
super
();
super
();
this
.
_type
=
type
;
this
.
_type
=
type
;
this
.
showImage
=
new
eui
.
Image
();
this
.
showImage
=
new
eui
.
Image
();
this
.
changeSource
(
"ele"
+
this
.
type
+
"_png"
);
this
.
changeSource
(
"ele"
+
this
.
type
+
"_png"
);
this
.
addChild
(
this
.
showImage
);
this
.
addChild
(
this
.
showImage
);
this
.
cannobox
=
new
eui
.
Group
();
this
.
cannobox
.
width
=
this
.
cannoboxwid
;
this
.
cannobox
.
height
=
this
.
cannoboxhei
;
this
.
cannobox
.
anchorOffsetX
=
this
.
cannoboxwid
/
2
;
this
.
cannobox
.
anchorOffsetY
=
this
.
cannoboxhei
/
2
;
this
.
addChild
(
this
.
cannobox
);
this
.
cannolab
=
new
eui
.
Label
();
this
.
cannolab
.
size
=
30
;
this
.
cannolab
.
textColor
=
0xff0000
;
this
.
cannolab
.
x
=
0
;
this
.
cannolab
.
y
=
0
;
this
.
addChild
(
this
.
cannolab
);
this
.
cannobox
.
visible
=
this
.
cannolab
.
visible
=
type
==
ElementType
.
CANNO
;
this
.
showImage
.
visible
=
type
!=
ElementType
.
CANNO
;
this
.
cannolab
.
visible
=
false
;
//鸡蛋
//鸡蛋
if
(
type
==
ElementType
.
CHICKEN_EGG
)
{
if
(
type
==
ElementType
.
CHICKEN_EGG
)
{
this
.
chickenEgg
=
Pool
.
takeOut
(
RecoverName
.
CHICKEN_EGG
)
this
.
chickenEgg
=
Pool
.
takeOut
(
RecoverName
.
CHICKEN_EGG
)
...
@@ -389,6 +465,61 @@ export class Element extends eui.Component {
...
@@ -389,6 +465,61 @@ export class Element extends eui.Component {
}
}
this
.
addChild
(
this
.
festivalEle
)
this
.
addChild
(
this
.
festivalEle
)
}
}
this
.
createCanno
();
}
//添加炮台
createCanno
(){
if
(
this
.
type
==
ElementType
.
CANNO
){
if
(
this
.
cannoMoveClip
){
return
;
}
if
(
!
svgaParser
)
svgaParser
=
new
window
[
"SVGA"
].
Parser
();
svgaParser
.
load
(
resPath
+
'resource/assets/svgas/canno.svga'
,
(
videoItem
)
=>
{
this
.
cannoMoveClip
=
new
window
[
"SVGA"
].
EgretMovieClip
(
videoItem
);
this
.
cannoMoveClip
.
lockStep
=
true
;
var
mvwidth
=
102
;
var
mvheight
=
116
;
this
.
cannoMoveClip
.
x
=
(
this
.
cannoboxwid
-
mvwidth
)
/
2
;
this
.
cannoMoveClip
.
y
=
0
;
this
.
cannobox
.
addChild
(
this
.
cannoMoveClip
);
console
.
log
(
"paotai"
,
this
.
cannoMoveClip
);
//1空,121,181,241,361
// this.cannoMoveClip.gotoAndStop(1);
// this.cannoMoveClip.gotoAndStop(120);
// this.cannoMoveClip.gotoAndStop(120);
// this.cannoMoveClip.gotoAndStop(180);
this
.
cannoMoveClip
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
listenCn
,
this
);
this
.
cannoMoveClip
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
this
.
playComplete
,
this
);
});
}
}
// curframeidx:number = 1;
// testChangeMoveClip(num:number){
// this.curframeidx += num;
// this.cannoMoveClip.gotoAndStop(this.curframeidx);
// }
/**
* 炮台充能
* @param source
*/
listenCn
(){
var
statend
=
this
.
cannoStat
[
this
.
_cannoStat
+
1
];
if
(
this
.
cannoMoveClip
.
currentFrame
>=
statend
){
// console.log("炮台阶段动画播放完毕",this.cannoMoveClip.currentFrame);
this
.
cannoMoveClip
.
stop
();
}
}
/**
* 炮台动画播放一次完毕
*/
playComplete
(){
this
.
cannoMoveClip
.
stop
();
}
}
/**
/**
...
@@ -398,7 +529,7 @@ export class Element extends eui.Component {
...
@@ -398,7 +529,7 @@ export class Element extends eui.Component {
changeSource
(
source
:
string
)
{
changeSource
(
source
:
string
)
{
// this.showImage.source = source;
// this.showImage.source = source;
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
source
);
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
source
);
if
(
!
texture
)
{
return
;
}
if
(
!
texture
)
{
return
console
.
error
(
"未找到纹理"
,
source
,
this
.
type
)
;
}
this
.
showImage
.
texture
=
texture
this
.
showImage
.
texture
=
texture
this
.
showImage
.
x
=
-
texture
.
textureWidth
/
2
;
this
.
showImage
.
x
=
-
texture
.
textureWidth
/
2
;
...
@@ -429,6 +560,10 @@ export class Element extends eui.Component {
...
@@ -429,6 +560,10 @@ export class Element extends eui.Component {
egret
.
Tween
.
removeTweens
(
this
.
showImage
);
egret
.
Tween
.
removeTweens
(
this
.
showImage
);
//类型重置,showImage修改
//类型重置,showImage修改
this
.
_type
=
type
;
this
.
_type
=
type
;
this
.
cannolab
.
visible
=
type
==
ElementType
.
CANNO
;
this
.
showImage
.
visible
=
type
!=
ElementType
.
CANNO
;
this
.
changeSource
(
"ele"
+
type
+
"_png"
);
this
.
changeSource
(
"ele"
+
type
+
"_png"
);
//特效重置
//特效重置
this
.
effectType
=
null
;
this
.
effectType
=
null
;
...
...
egret/src/something/enum/ElementConfigType.ts
View file @
dd80c5fb
...
@@ -67,4 +67,11 @@ export enum ElementConfigType {
...
@@ -67,4 +67,11 @@ export enum ElementConfigType {
FISH
=
15
,
FISH
=
15
,
HONEY_POT
=
16
,
HONEY_POT
=
16
,
FLOWER
=
17
,
FLOWER
=
17
,
/** 大炮 */
CANNO_DIR_TOP
=
18
,
CANNO_DIR_BOTTOM
=
19
,
CANNO_DIR_LEFT
=
20
,
CANNO_DIR_RIGHT
=
21
,
/** 大炮石头 */
CANNO_BLOCK
=
22
,
}
}
\ No newline at end of file
egret/src/something/enum/ElementType.ts
View file @
dd80c5fb
...
@@ -30,34 +30,36 @@ export enum ElementType {
...
@@ -30,34 +30,36 @@ export enum ElementType {
FESTIVALELE_BIG
,
//节日元素大中间一个13
FESTIVALELE_BIG
,
//节日元素大中间一个13
FESTIVALELE_SMALL
,
//节日元素飞溅的小元素14
FESTIVALELE_SMALL
,
//节日元素飞溅的小元素14
CANDY_RABBIT
,
//兔子
CANDY_RABBIT
,
//兔子
15
CANDY_CHICKEN
,
//鸟
CANDY_CHICKEN
,
//鸟
16
CANDY_CATTLE
,
//牛
CANDY_CATTLE
,
//牛
17
CANDY_LION
,
//狮子
CANDY_LION
,
//狮子
18
CANDY_PIG
,
//猪
CANDY_PIG
,
//猪
19
MONSTER_JELLY1
,
MONSTER_JELLY1
,
//20
JELLY_MONSTER
,
JELLY_MONSTER
,
//21
FIREWORKS_RABBIT
,
//烟花目标元素,下同
FIREWORKS_RABBIT
,
//烟花目标元素,下同
22
FIREWORKS_CHICKEN
,
FIREWORKS_CHICKEN
,
//23
FIREWORKS_CATTLE
,
FIREWORKS_CATTLE
,
//24
FIREWORKS_LION
,
FIREWORKS_LION
,
//25
FIREWORKS_PIG
,
FIREWORKS_PIG
,
//26
FIREWORKS_SHOOTER
,
//烟花
FIREWORKS_SHOOTER
,
//烟花
27
MONSTER_RABBIT
,
//独眼怪
MONSTER_RABBIT
,
//独眼怪
28
MONSTER_CHICKEN
,
MONSTER_CHICKEN
,
//29
MONSTER_CATTLE
,
MONSTER_CATTLE
,
//30
MONSTER_LION
,
MONSTER_LION
,
//31
MONSTER_PIG
,
MONSTER_PIG
,
//32
FISH
,
//气鼓鱼
FISH
,
//气鼓鱼33
HONEY
,
// 蜂蜜
HONEY
,
// 蜂蜜34
HONEY_POT
,
//蜂蜜罐
HONEY_POT
,
//蜂蜜罐35
SAND
,
SAND
,
//36
FLOWER
,
FLOWER
,
//37
CANNO
,
//38
CANNO_BLOCK
,
//39
}
}
export
const
isMonsterEle
=
(
t
:
ElementType
)
=>
{
export
const
isMonsterEle
=
(
t
:
ElementType
)
=>
{
...
@@ -88,6 +90,12 @@ export enum MonsterBaseElementType {
...
@@ -88,6 +90,12 @@ export enum MonsterBaseElementType {
}
}
export
enum
forwardDirection
{
left
=
"left"
,
up
=
"up"
,
right
=
"right"
,
down
=
"down"
,
}
export
const
fireworksTypeMap
:
any
=
{}
export
const
fireworksTypeMap
:
any
=
{}
fireworksTypeMap
[
ElementType
.
RABBIT
]
=
ElementType
.
FIREWORKS_RABBIT
;
fireworksTypeMap
[
ElementType
.
RABBIT
]
=
ElementType
.
FIREWORKS_RABBIT
;
fireworksTypeMap
[
ElementType
.
CHICKEN
]
=
ElementType
.
FIREWORKS_CHICKEN
;
fireworksTypeMap
[
ElementType
.
CHICKEN
]
=
ElementType
.
FIREWORKS_CHICKEN
;
...
@@ -151,6 +159,13 @@ export const monsterElementMap = {
...
@@ -151,6 +159,13 @@ export const monsterElementMap = {
"5"
:
ElementType
.
PIG
,
"5"
:
ElementType
.
PIG
,
}
}
export
const
connoDirection
=
{
"1"
:
forwardDirection
.
left
,
"2"
:
forwardDirection
.
up
,
"3"
:
forwardDirection
.
right
,
"4"
:
forwardDirection
.
down
,
}
export
const
elementMonsterResMap
=
{
export
const
elementMonsterResMap
=
{
"0"
:
ElementType
.
MONSTER_RABBIT
,
"0"
:
ElementType
.
MONSTER_RABBIT
,
"1"
:
ElementType
.
MONSTER_CHICKEN
,
"1"
:
ElementType
.
MONSTER_CHICKEN
,
...
...
egret/src/something/interface/MapData.ts
View file @
dd80c5fb
import
{
GenerateLatData
}
from
"./GenerateLatData"
;
import
{
GenerateLatData
}
from
"./GenerateLatData"
;
import
{
LatticeType
}
from
"../enum/LatticeType"
;
import
{
LatticeType
}
from
"../enum/LatticeType"
;
import
{
ElementConfigType
}
from
"../enum/ElementConfigType"
;
/**
/**
* 地图数据接口
* 地图数据接口
* 包括地图格子,和地图上的特殊元素,生成口,联通口
* 包括地图格子,和地图上的特殊元素,生成口,联通口
*/
*/
export
interface
MapData
{
export
interface
MapData
{
/**
* 传送带
*/
conveyor
?:
number
[][];
conveyor
?:
number
[][];
conveyorConnectedLats
?:
number
[][];
conveyorConnectedLats
?:
number
[][];
/**
/**
...
@@ -42,7 +46,7 @@ export interface MapData {
...
@@ -42,7 +46,7 @@ export interface MapData {
* 9褐色毛球 特效消除,分裂
* 9褐色毛球 特效消除,分裂
* 10黑色毛球 两次消除,一次眩晕,
* 10黑色毛球 两次消除,一次眩晕,
*/
*/
elements
?:
number
[];
elements
?:
ElementConfigType
[];
/**
/**
* 9*9的格子,不修改写null或[]
* 9*9的格子,不修改写null或[]
* 十位是基础元素类型,对应数字减1就是基础元素类型
* 十位是基础元素类型,对应数字减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