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
3a9081eb
Commit
3a9081eb
authored
Nov 05, 2019
by
邱旭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
6b27b6af
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
4 deletions
+33
-4
RainObj.ts
egret/src/panels/HongbaoRain/RainObj.ts
+33
-4
No files found.
egret/src/panels/HongbaoRain/RainObj.ts
View file @
3a9081eb
...
@@ -33,18 +33,47 @@ export default class RainObj {
...
@@ -33,18 +33,47 @@ export default class RainObj {
}
}
private
touchTap
()
{
private
touchTap
()
{
GDispatcher
.
dispatchEvent
(
'hbGameAddScore'
,
RainData
.
data
[
this
.
data
.
key
].
score
);
egret
.
Tween
.
removeTweens
(
this
.
module
);
this
.
module
.
source
=
`hbGame_
${
this
.
data
.
key
}
_touch_png`
;
this
.
moduleEffect
();
// 模型特效
GDispatcher
.
dispatchEvent
(
'hbGameAddScore'
,
RainData
.
data
[
this
.
data
.
key
].
score
);
// 加分
this
.
addScoreEffect
();
// 添加分数特效
this
.
destroy
();
this
.
destroy
();
}
}
// 模型特效
private
moduleEffect
()
{
let
_scaleX
=
this
.
module
.
scaleX
;
let
_scaleY
=
this
.
module
.
scaleY
;
egret
.
Tween
.
get
(
this
.
module
).
to
({
scaleX
:
_scaleX
+
0.2
,
scaleY
:
_scaleY
+
0.2
},
100
).
call
(()
=>
{
this
.
module
.
source
=
`hbGame_
${
this
.
data
.
key
}
_touch_png`
;
egret
.
Tween
.
get
(
this
.
module
).
to
({
scaleX
:
_scaleX
,
scaleY
:
_scaleY
},
100
);
});
}
// 添加分数特效
private
addScoreEffect
()
{
setTimeout
(()
=>
{
let
score
=
new
eui
.
Image
(
`hbGame_+
${
RainData
.
data
[
this
.
data
.
key
].
score
}
_png`
);
let
_x
=
score
.
x
=
this
.
module
.
x
-
20
;
let
_y
=
score
.
y
=
this
.
module
.
y
;
score
.
scaleY
=
score
.
scaleX
=
0.3
;
score
.
alpha
=
0
;
this
.
rainGroup
.
addChild
(
score
);
egret
.
Tween
.
get
(
score
).
to
({
y
:
_y
-
60
,
scaleX
:
1
,
scaleY
:
1
,
alpha
:
1
},
400
).
call
(()
=>
{
egret
.
Tween
.
get
(
score
).
to
({
y
:
_y
-
120
,
alpha
:
0
},
400
).
call
(()
=>
{
score
.
visible
=
false
});
});
},
500
);
}
private
destroy
()
{
private
destroy
()
{
egret
.
Tween
.
removeTweens
(
this
.
module
);
this
.
module
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
touchTap
,
this
);
this
.
module
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
touchTap
,
this
);
this
.
module
.
touchEnabled
=
false
;
this
.
module
.
touchEnabled
=
false
;
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
rainGroup
.
removeChild
(
this
.
module
);
this
.
rainGroup
.
removeChild
(
this
.
module
);
this
.
data
.
pool
.
push
(
this
);
this
.
data
.
pool
.
push
(
this
);
},
10
00
);
},
6
00
);
}
}
}
}
\ No newline at end of file
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