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";
...
@@ -4,6 +4,7 @@ import { State } from "../class/State";
import
{
Pool
}
from
"../Pool"
;
import
{
Pool
}
from
"../Pool"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
import
{
RES
}
from
"../../../module/RES"
;
/**
/**
* 变色气泡状态
* 变色气泡状态
...
@@ -13,18 +14,18 @@ export class BubbleState extends State {
...
@@ -13,18 +14,18 @@ export class BubbleState extends State {
/**
/**
* 显示图片
* 显示图片
*/
*/
private
showImage
:
egret
.
Bitmap
;
private
showImage
:
FYGE
.
Sprite
;
constructor
(
type
:
ElementType
)
{
constructor
(
type
:
ElementType
)
{
super
();
super
();
this
.
showImage
=
new
egret
.
Bitmap
();
this
.
showImage
=
new
FYGE
.
Sprite
();
this
.
changeSource
(
"bubleEle"
+
type
+
"
_
png"
);
this
.
changeSource
(
"bubleEle"
+
type
+
"
.
png"
);
this
.
addChild
(
this
.
showImage
);
this
.
addChild
(
this
.
showImage
);
}
}
//重置为指定的类型,直接设置。没有过度动效
//重置为指定的类型,直接设置。没有过度动效
reset
(
type
:
ElementType
)
{
reset
(
type
:
ElementType
)
{
this
.
changeSource
(
"bubleEle"
+
type
+
"
_
png"
);
this
.
changeSource
(
"bubleEle"
+
type
+
"
.
png"
);
}
}
//直接回收
//直接回收
recover
()
{
recover
()
{
...
@@ -33,9 +34,9 @@ export class BubbleState extends State {
...
@@ -33,9 +34,9 @@ export class BubbleState extends State {
}
}
private
changeSource
(
source
:
string
)
{
private
changeSource
(
source
:
string
)
{
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
source
);
var
texture
:
FYGE
.
Texture
=
RES
.
getRes
(
source
);
this
.
showImage
.
texture
=
texture
;
this
.
showImage
.
texture
=
texture
;
this
.
showImage
.
x
=
-
texture
.
textureW
idth
/
2
;
this
.
showImage
.
x
=
-
texture
.
w
idth
/
2
;
this
.
showImage
.
y
=
-
texture
.
textureH
eight
/
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";
...
@@ -4,13 +4,14 @@ import { State } from "../class/State";
import
{
Pool
}
from
"../Pool"
;
import
{
Pool
}
from
"../Pool"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
import
{
RES
}
from
"../../../module/RES"
;
/**
/**
* 黑色毛球状态
* 黑色毛球状态
* 两次消除,需要修改图片,,,再说,还没写,切换眩晕状态,是否有动画,都再说
* 两次消除,需要修改图片,,,再说,还没写,切换眩晕状态,是否有动画,都再说
*/
*/
export
class
HairballBlackState
extends
State
{
export
class
HairballBlackState
extends
State
{
private
showImage
:
egret
.
Bitmap
;
private
showImage
:
FYGE
.
Sprite
;
/**
/**
* 是否激活
* 是否激活
*/
*/
...
@@ -24,15 +25,15 @@ export class HairballBlackState extends State {
...
@@ -24,15 +25,15 @@ export class HairballBlackState extends State {
}
}
constructor
()
{
constructor
()
{
super
();
super
();
this
.
showImage
=
new
egret
.
Bitmap
();
this
.
showImage
=
new
FYGE
.
Sprite
();
this
.
addChild
(
this
.
showImage
);
this
.
addChild
(
this
.
showImage
);
this
.
changeSource
(
"ele"
+
ElementType
.
HAIRBALLBLACK
+
"
_
png"
)
this
.
changeSource
(
"ele"
+
ElementType
.
HAIRBALLBLACK
+
"
.
png"
)
this
.
_isAwake
=
true
;
this
.
_isAwake
=
true
;
}
}
reset
()
{
reset
()
{
this
.
_isAwake
=
true
;
this
.
_isAwake
=
true
;
//换图
//换图
this
.
changeSource
(
"ele"
+
ElementType
.
HAIRBALLBLACK
+
"
_
png"
)
this
.
changeSource
(
"ele"
+
ElementType
.
HAIRBALLBLACK
+
"
.
png"
)
}
}
recover
()
{
recover
()
{
if
(
this
.
parent
)
this
.
parent
.
removeChild
(
this
);
if
(
this
.
parent
)
this
.
parent
.
removeChild
(
this
);
...
@@ -40,9 +41,9 @@ export class HairballBlackState extends State {
...
@@ -40,9 +41,9 @@ export class HairballBlackState extends State {
}
}
private
changeSource
(
source
:
string
)
{
private
changeSource
(
source
:
string
)
{
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
source
);
var
texture
:
FYGE
.
Texture
=
RES
.
getRes
(
source
);
this
.
showImage
.
texture
=
texture
;
this
.
showImage
.
texture
=
texture
;
this
.
showImage
.
x
=
-
texture
.
textureW
idth
/
2
;
this
.
showImage
.
x
=
-
texture
.
w
idth
/
2
;
this
.
showImage
.
y
=
-
texture
.
textureH
eight
/
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";
...
@@ -4,24 +4,25 @@ import { State } from "../class/State";
import
{
Pool
}
from
"../Pool"
;
import
{
Pool
}
from
"../Pool"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
import
{
RES
}
from
"../../../module/RES"
;
/**
/**
* 褐色帽绣毛球状态
* 褐色帽绣毛球状态
* 分裂动画都在外面单独掉
* 分裂动画都在外面单独掉
*/
*/
export
class
HairballBrownState
extends
State
{
export
class
HairballBrownState
extends
State
{
private
showImage
:
egret
.
Bitmap
;
private
showImage
:
FYGE
.
Sprite
;
/**
/**
* 是否激活
* 是否激活
*/
*/
isActive
:
boolean
;
isActive
:
boolean
;
constructor
()
{
constructor
()
{
super
();
super
();
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
"ele"
+
ElementType
.
HAIRBALLBROWN
+
"_
png"
)
var
texture
:
FYGE
.
Texture
=
RES
.
getRes
(
"ele"
+
ElementType
.
HAIRBALLBROWN
+
".
png"
)
this
.
showImage
=
new
egret
.
Bitmap
(
texture
);
this
.
showImage
=
new
FYGE
.
Sprite
(
texture
);
this
.
addChild
(
this
.
showImage
);
this
.
addChild
(
this
.
showImage
);
this
.
showImage
.
x
=
-
texture
.
textureW
idth
/
2
;
this
.
showImage
.
x
=
-
texture
.
w
idth
/
2
;
this
.
showImage
.
y
=
-
texture
.
textureH
eight
/
2
;
this
.
showImage
.
y
=
-
texture
.
h
eight
/
2
;
this
.
isActive
=
false
;
this
.
isActive
=
false
;
}
}
reset
()
{
reset
()
{
...
@@ -33,9 +34,9 @@ export class HairballBrownState extends State {
...
@@ -33,9 +34,9 @@ export class HairballBrownState extends State {
}
}
private
changeSource
(
source
:
string
)
{
private
changeSource
(
source
:
string
)
{
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
source
);
var
texture
:
FYGE
.
Texture
=
RES
.
getRes
(
source
);
this
.
showImage
.
texture
=
texture
;
this
.
showImage
.
texture
=
texture
;
this
.
showImage
.
x
=
-
texture
.
textureW
idth
/
2
;
this
.
showImage
.
x
=
-
texture
.
w
idth
/
2
;
this
.
showImage
.
y
=
-
texture
.
textureH
eight
/
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 @@
...
@@ -3,20 +3,21 @@
import
{
State
}
from
"../class/State"
;
import
{
State
}
from
"../class/State"
;
import
{
Pool
}
from
"../Pool"
;
import
{
Pool
}
from
"../Pool"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
{
RES
}
from
"../../../module/RES"
;
/**
/**
* 枷锁状态
* 枷锁状态
* 动画比较简单,直接写这里
* 动画比较简单,直接写这里
*/
*/
export
class
LockState
extends
State
{
export
class
LockState
extends
State
{
private
showImage
:
egret
.
Bitmap
;
private
showImage
:
FYGE
.
Sprite
;
constructor
()
{
constructor
()
{
super
();
super
();
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
"lockVine_
png"
)
var
texture
:
FYGE
.
Texture
=
RES
.
getRes
(
"lockVine.
png"
)
this
.
showImage
=
new
egret
.
Bitmap
(
texture
);
this
.
showImage
=
new
FYGE
.
Sprite
(
texture
);
this
.
addChild
(
this
.
showImage
);
this
.
addChild
(
this
.
showImage
);
this
.
showImage
.
x
=
-
texture
.
textureW
idth
/
2
;
this
.
showImage
.
x
=
-
texture
.
w
idth
/
2
;
this
.
showImage
.
y
=
-
texture
.
textureH
eight
/
2
this
.
showImage
.
y
=
-
texture
.
h
eight
/
2
}
}
reset
()
{
reset
()
{
this
.
alpha
=
1
;
this
.
alpha
=
1
;
...
@@ -24,7 +25,7 @@ export class LockState extends State {
...
@@ -24,7 +25,7 @@ export class LockState extends State {
//要不要把动画放在这里,这种移除动效最好统一外面,常驻动效才
//要不要把动画放在这里,这种移除动效最好统一外面,常驻动效才
recover
()
{
recover
()
{
egret
.
Tween
.
get
(
this
)
FYGE
.
Tween
.
get
(
this
)
.
to
({
alpha
:
0
},
750
)
.
to
({
alpha
:
0
},
750
)
.
call
(()
=>
{
.
call
(()
=>
{
if
(
this
.
parent
)
this
.
parent
.
removeChild
(
this
);
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