Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
babycare_xiaoxiao
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
翁阳
babycare_xiaoxiao
Commits
1d18eacb
Commit
1d18eacb
authored
Jul 09, 2020
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
813ca7dc
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
28 deletions
+32
-28
BubbleState.ts
src/something/states/BubbleState.ts
+8
-7
HairballBlackState.ts
src/something/states/HairballBlackState.ts
+8
-7
HairballBrownState.ts
src/something/states/HairballBrownState.ts
+9
-8
LockState.ts
src/something/states/LockState.ts
+7
-6
No files found.
src/something/states/BubbleState.ts
View file @
1d18eacb
...
...
@@ -4,6 +4,7 @@ import { State } from "../class/State";
import
{
Pool
}
from
"../Pool"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
import
{
RES
}
from
"../../../module/RES"
;
/**
* 变色气泡状态
...
...
@@ -13,18 +14,18 @@ export class BubbleState extends State {
/**
* 显示图片
*/
private
showImage
:
egret
.
Bitmap
;
private
showImage
:
FYGE
.
Sprite
;
constructor
(
type
:
ElementType
)
{
super
();
this
.
showImage
=
new
egret
.
Bitmap
();
this
.
changeSource
(
"bubleEle"
+
type
+
"
_
png"
);
this
.
showImage
=
new
FYGE
.
Sprite
();
this
.
changeSource
(
"bubleEle"
+
type
+
"
.
png"
);
this
.
addChild
(
this
.
showImage
);
}
//重置为指定的类型,直接设置。没有过度动效
reset
(
type
:
ElementType
)
{
this
.
changeSource
(
"bubleEle"
+
type
+
"
_
png"
);
this
.
changeSource
(
"bubleEle"
+
type
+
"
.
png"
);
}
//直接回收
recover
()
{
...
...
@@ -33,9 +34,9 @@ export class BubbleState extends State {
}
private
changeSource
(
source
:
string
)
{
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
source
);
var
texture
:
FYGE
.
Texture
=
RES
.
getRes
(
source
);
this
.
showImage
.
texture
=
texture
;
this
.
showImage
.
x
=
-
texture
.
textureW
idth
/
2
;
this
.
showImage
.
y
=
-
texture
.
textureH
eight
/
2
this
.
showImage
.
x
=
-
texture
.
w
idth
/
2
;
this
.
showImage
.
y
=
-
texture
.
h
eight
/
2
}
}
\ No newline at end of file
src/something/states/HairballBlackState.ts
View file @
1d18eacb
...
...
@@ -4,13 +4,14 @@ import { State } from "../class/State";
import
{
Pool
}
from
"../Pool"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
import
{
RES
}
from
"../../../module/RES"
;
/**
* 黑色毛球状态
* 两次消除,需要修改图片,,,再说,还没写,切换眩晕状态,是否有动画,都再说
*/
export
class
HairballBlackState
extends
State
{
private
showImage
:
egret
.
Bitmap
;
private
showImage
:
FYGE
.
Sprite
;
/**
* 是否激活
*/
...
...
@@ -24,15 +25,15 @@ export class HairballBlackState extends State {
}
constructor
()
{
super
();
this
.
showImage
=
new
egret
.
Bitmap
();
this
.
showImage
=
new
FYGE
.
Sprite
();
this
.
addChild
(
this
.
showImage
);
this
.
changeSource
(
"ele"
+
ElementType
.
HAIRBALLBLACK
+
"
_
png"
)
this
.
changeSource
(
"ele"
+
ElementType
.
HAIRBALLBLACK
+
"
.
png"
)
this
.
_isAwake
=
true
;
}
reset
()
{
this
.
_isAwake
=
true
;
//换图
this
.
changeSource
(
"ele"
+
ElementType
.
HAIRBALLBLACK
+
"
_
png"
)
this
.
changeSource
(
"ele"
+
ElementType
.
HAIRBALLBLACK
+
"
.
png"
)
}
recover
()
{
if
(
this
.
parent
)
this
.
parent
.
removeChild
(
this
);
...
...
@@ -40,9 +41,9 @@ export class HairballBlackState extends State {
}
private
changeSource
(
source
:
string
)
{
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
source
);
var
texture
:
FYGE
.
Texture
=
RES
.
getRes
(
source
);
this
.
showImage
.
texture
=
texture
;
this
.
showImage
.
x
=
-
texture
.
textureW
idth
/
2
;
this
.
showImage
.
y
=
-
texture
.
textureH
eight
/
2
this
.
showImage
.
x
=
-
texture
.
w
idth
/
2
;
this
.
showImage
.
y
=
-
texture
.
h
eight
/
2
}
}
\ No newline at end of file
src/something/states/HairballBrownState.ts
View file @
1d18eacb
...
...
@@ -4,24 +4,25 @@ import { State } from "../class/State";
import
{
Pool
}
from
"../Pool"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
import
{
RES
}
from
"../../../module/RES"
;
/**
* 褐色帽绣毛球状态
* 分裂动画都在外面单独掉
*/
export
class
HairballBrownState
extends
State
{
private
showImage
:
egret
.
Bitmap
;
private
showImage
:
FYGE
.
Sprite
;
/**
* 是否激活
*/
isActive
:
boolean
;
constructor
()
{
super
();
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
"ele"
+
ElementType
.
HAIRBALLBROWN
+
"_
png"
)
this
.
showImage
=
new
egret
.
Bitmap
(
texture
);
var
texture
:
FYGE
.
Texture
=
RES
.
getRes
(
"ele"
+
ElementType
.
HAIRBALLBROWN
+
".
png"
)
this
.
showImage
=
new
FYGE
.
Sprite
(
texture
);
this
.
addChild
(
this
.
showImage
);
this
.
showImage
.
x
=
-
texture
.
textureW
idth
/
2
;
this
.
showImage
.
y
=
-
texture
.
textureH
eight
/
2
;
this
.
showImage
.
x
=
-
texture
.
w
idth
/
2
;
this
.
showImage
.
y
=
-
texture
.
h
eight
/
2
;
this
.
isActive
=
false
;
}
reset
()
{
...
...
@@ -33,9 +34,9 @@ export class HairballBrownState extends State {
}
private
changeSource
(
source
:
string
)
{
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
source
);
var
texture
:
FYGE
.
Texture
=
RES
.
getRes
(
source
);
this
.
showImage
.
texture
=
texture
;
this
.
showImage
.
x
=
-
texture
.
textureW
idth
/
2
;
this
.
showImage
.
y
=
-
texture
.
textureH
eight
/
2
this
.
showImage
.
x
=
-
texture
.
w
idth
/
2
;
this
.
showImage
.
y
=
-
texture
.
h
eight
/
2
}
}
\ No newline at end of file
src/something/states/LockState.ts
View file @
1d18eacb
...
...
@@ -3,20 +3,21 @@
import
{
State
}
from
"../class/State"
;
import
{
Pool
}
from
"../Pool"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
{
RES
}
from
"../../../module/RES"
;
/**
* 枷锁状态
* 动画比较简单,直接写这里
*/
export
class
LockState
extends
State
{
private
showImage
:
egret
.
Bitmap
;
private
showImage
:
FYGE
.
Sprite
;
constructor
()
{
super
();
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
"lockVine_
png"
)
this
.
showImage
=
new
egret
.
Bitmap
(
texture
);
var
texture
:
FYGE
.
Texture
=
RES
.
getRes
(
"lockVine.
png"
)
this
.
showImage
=
new
FYGE
.
Sprite
(
texture
);
this
.
addChild
(
this
.
showImage
);
this
.
showImage
.
x
=
-
texture
.
textureW
idth
/
2
;
this
.
showImage
.
y
=
-
texture
.
textureH
eight
/
2
this
.
showImage
.
x
=
-
texture
.
w
idth
/
2
;
this
.
showImage
.
y
=
-
texture
.
h
eight
/
2
}
reset
()
{
this
.
alpha
=
1
;
...
...
@@ -24,7 +25,7 @@ export class LockState extends State {
//要不要把动画放在这里,这种移除动效最好统一外面,常驻动效才
recover
()
{
egret
.
Tween
.
get
(
this
)
FYGE
.
Tween
.
get
(
this
)
.
to
({
alpha
:
0
},
750
)
.
call
(()
=>
{
if
(
this
.
parent
)
this
.
parent
.
removeChild
(
this
);
...
...
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