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
5d968947
Commit
5d968947
authored
Nov 04, 2019
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
23c57f37
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
7 deletions
+88
-7
Element.ts
egret/src/something/class/Element.ts
+8
-6
FestivalEle.ts
egret/src/something/class/FestivalEle.ts
+73
-0
ElementType.ts
egret/src/something/enum/ElementType.ts
+7
-1
No files found.
egret/src/something/class/Element.ts
View file @
5d968947
...
...
@@ -105,10 +105,10 @@ export class Element extends eui.Component {
// console.log(this)
}
}
magicLionBgAni
:
MagicLionBgAni
;
horizontalBgAni
:
HorizontalBgAni
;
verticalBgAni
:
VerticalBgAni
;
explosiveBgAni
:
ExplosiveBgAni
;
private
magicLionBgAni
:
MagicLionBgAni
;
private
horizontalBgAni
:
HorizontalBgAni
;
private
verticalBgAni
:
VerticalBgAni
;
private
explosiveBgAni
:
ExplosiveBgAni
;
/**
* 索引
*/
...
...
@@ -166,8 +166,10 @@ export class Element extends eui.Component {
this
.
showImage
.
x
=
-
texture
.
textureWidth
/
2
;
this
.
showImage
.
y
=
-
texture
.
textureHeight
/
2
;
//特殊逻辑,因为魔力鸟动效要旋转,所以隐藏原图showImage,还有鸡蛋
if
(
source
==
"magicLion_png"
||
source
==
"ele"
+
ElementType
.
CHICKEN_EGG
+
"_png"
)
{
//特殊逻辑,因为魔力鸟动效要旋转,所以隐藏原图showImage,还有鸡蛋,还有特殊节日元素大
if
(
source
==
"magicLion_png"
||
source
==
"ele"
+
ElementType
.
CHICKEN_EGG
+
"_png"
||
source
==
"ele"
+
ElementType
.
FESTIVALELE_BIG
+
"_png"
)
{
this
.
showImage
.
alpha
=
0
;
}
else
{
this
.
showImage
.
alpha
=
1
;
...
...
egret/src/something/class/FestivalEle.ts
0 → 100644
View file @
5d968947
import
{
ElementType
}
from
"../enum/ElementType"
;
//三种状态的图片,剩三种了
const
images
=
{
2
:
"ele"
+
ElementType
.
CHICKEN_EGG
+
"_png"
,
1
:
"eggStatus1_png"
,
0
:
"eggStatus0_png"
}
/**
* 节日元素
*
*/
export
class
FestivalEle
extends
eui
.
Component
{
private
showImage
:
eui
.
Image
;
/**
* 是否要分裂了
*/
isActive
:
boolean
;
/**
* 状态变化 2 1 0 再往后,可分裂
*/
private
_statusNum
:
number
;
get
statusNum
()
{
return
this
.
_statusNum
}
set
statusNum
(
value
:
number
)
{
if
(
value
>=
0
)
{
this
.
_statusNum
=
value
;
//修改图片
if
(
this
.
showImage
.
source
!=
images
[
this
.
_statusNum
])
{
this
.
changeSource
(
images
[
this
.
_statusNum
]);
}
}
else
{
this
.
_statusNum
=
0
;
this
.
isActive
=
true
;
}
}
constructor
(
n
:
number
=
2
)
{
super
()
this
.
showImage
=
new
eui
.
Image
();
this
.
addChild
(
this
.
showImage
)
this
.
changeSource
(
images
[
n
]);
this
.
isActive
=
false
;
this
.
_statusNum
=
n
;
}
changeSource
(
source
:
string
)
{
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
source
);
this
.
showImage
.
texture
=
texture
this
.
showImage
.
anchorOffsetX
=
texture
.
textureWidth
/
2
;
this
.
showImage
.
anchorOffsetY
=
texture
.
textureHeight
/
2
+
20
;
this
.
showImage
.
y
=
20
}
shakeAni
()
{
this
.
showImage
.
rotation
=
0
;
egret
.
Tween
.
get
(
this
.
showImage
)
.
to
({
rotation
:
10
},
80
)
.
to
({
rotation
:
-
8
},
160
)
.
to
({
rotation
:
5
},
160
)
.
to
({
rotation
:
0
},
50
)
}
reset
(
n
:
number
=
2
)
{
this
.
changeSource
(
images
[
n
]);
this
.
isActive
=
false
;
this
.
_statusNum
=
n
;
}
}
\ No newline at end of file
egret/src/something/enum/ElementType.ts
View file @
5d968947
/**
* 元素类型 <=4就是基础元素
* 枚举尽量从后面添加,否则要改很多东西,submitTran重新对应,ele图片重新对应,开始弹框目标实现等等,没改全后果自负
*
修改索引时,需要修改ele的图片,和通关目标类。飞入特效类
*
讲道理应该只有基础类型和特殊类型,但是为了通关目标也放入了冰块,元素身上的状态,
*/
export
enum
ElementType
{
//基础5种元素
...
...
@@ -25,10 +25,16 @@ export enum ElementType {
HAIRBALLGREY
,
//灰色毛球10
HAIRBALLBROWN
,
//褐色毛球11
HAIRBALLBLACK
,
//黑色毛球12
//特殊元素 ,节日元素
FESTIVALELE_BIG
,
//节日元素大中间一个13
FESTIVALELE_SMALL
//节日元素飞溅的小元素14
}
/**
* 5种基本元素的数组,每项是ElementType的枚举值
* 判断某类型是否是基础类型用FiveBaseElementTypes.indexOf(baseType) > -1
*/
export
const
FiveBaseElementTypes
:
ElementType
[]
=
[
ElementType
.
RABBIT
,
...
...
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