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
b909732b
Commit
b909732b
authored
Jun 05, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
樱花动画
parent
556f8e84
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
MainScene.ts
egret/src/mainScene/MainScene.ts
+16
-4
getChapter.ts
egret/src/something/chapters/getChapter.ts
+1
-1
Element.ts
egret/src/something/class/Element.ts
+1
-0
No files found.
egret/src/mainScene/MainScene.ts
View file @
b909732b
...
@@ -3183,7 +3183,7 @@ export default class MainScene extends Scene {
...
@@ -3183,7 +3183,7 @@ export default class MainScene extends Scene {
//樱花绽放
//樱花绽放
var
amove
=
this
.
checkFaCherry
();
var
amove
=
this
.
checkFaCherry
();
if
(
!
amove
){
if
(
!
amove
){
console
.
log
(
"樱花未消除,等待消除"
);
//
console.log("樱花未消除,等待消除");
this
.
waitCherry
=
true
;
this
.
waitCherry
=
true
;
return
;
return
;
}
else
{
}
else
{
...
@@ -7706,6 +7706,12 @@ export default class MainScene extends Scene {
...
@@ -7706,6 +7706,12 @@ export default class MainScene extends Scene {
//樱花动画
//樱花动画
playCherryAni
(
idx
:
number
,
statold
,
statnew
,
isfina
:
boolean
){
playCherryAni
(
idx
:
number
,
statold
,
statnew
,
isfina
:
boolean
){
let
lastani
=
this
.
effectContainer
.
getChildByName
(
"cherryAni_"
+
idx
);
if
(
lastani
){
let
lastoname
=
lastani
[
"oname"
];
this
.
effectContainer
.
removeChild
(
lastani
);
cherryAniArr
[
lastoname
].
push
(
lastani
);
}
let
oneani
:
any
;
let
oneani
:
any
;
let
aniname
=
"cherry"
+
statold
+
"_"
+
statnew
;
let
aniname
=
"cherry"
+
statold
+
"_"
+
statnew
;
...
@@ -7725,6 +7731,9 @@ export default class MainScene extends Scene {
...
@@ -7725,6 +7731,9 @@ export default class MainScene extends Scene {
// console.log(statold,statnew,idx,oneani.totalFrames);
// console.log(statold,statnew,idx,oneani.totalFrames);
oneani
.
x
=
p
[
0
]
-
100
;
oneani
.
x
=
p
[
0
]
-
100
;
oneani
.
y
=
p
[
1
]
-
100
;
oneani
.
y
=
p
[
1
]
-
100
;
oneani
.
touchEnabled
=
false
;
oneani
.
name
=
"cherryAni_"
+
idx
;
oneani
[
"oname"
]
=
aniname
;
this
.
effectContainer
.
addChild
(
oneani
);
this
.
effectContainer
.
addChild
(
oneani
);
let
framefunc
=
()
=>
{
let
framefunc
=
()
=>
{
...
@@ -7765,10 +7774,13 @@ export default class MainScene extends Scene {
...
@@ -7765,10 +7774,13 @@ export default class MainScene extends Scene {
}
}
let
compfunc
=
()
=>
{
let
compfunc
=
()
=>
{
oneani
.
removeEventListener
(
egret
.
Event
.
COMPLETE
,
compfunc
,
this
);
oneani
.
removeEventListener
(
egret
.
Event
.
COMPLETE
,
compfunc
,
this
);
oneani
.
stop
();
if
(
isfina
){
//移除樱花动画
//移除樱花动画
this
.
effectContainer
.
removeChild
(
oneani
);
this
.
effectContainer
.
removeChild
(
oneani
);
cherryAniArr
[
aniname
].
push
(
oneani
);
cherryAniArr
[
aniname
].
push
(
oneani
);
}
}
}
oneani
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
framefunc
,
this
);
oneani
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
framefunc
,
this
);
oneani
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
compfunc
,
this
);
oneani
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
compfunc
,
this
);
...
...
egret/src/something/chapters/getChapter.ts
View file @
b909732b
...
@@ -88,7 +88,7 @@ chapters.forEach((chapter,index) => {
...
@@ -88,7 +88,7 @@ chapters.forEach((chapter,index) => {
* @param index 关数 从1开始
* @param index 关数 从1开始
*/
*/
export
function
getChapterData
(
index
:
number
):
ChapterData
{
export
function
getChapterData
(
index
:
number
):
ChapterData
{
return
chapters
[
801
];
//
return chapters[801];
//没有数据就返回第一关数据
//没有数据就返回第一关数据
return
chapters
[
index
]
||
chapters
[
1
];
return
chapters
[
index
]
||
chapters
[
1
];
}
}
...
...
egret/src/something/class/Element.ts
View file @
b909732b
...
@@ -1346,6 +1346,7 @@ export class Element extends eui.Component {
...
@@ -1346,6 +1346,7 @@ export class Element extends eui.Component {
this
.
cherrystat
+=
1
;
this
.
cherrystat
+=
1
;
this
.
isInCherryAni
=
true
;
this
.
isInCherryAni
=
true
;
this
.
setCherryImg
();
this
.
setCherryImg
();
this
.
showImage
.
alpha
=
0
;
}
}
}
}
activeCherry
(){
activeCherry
(){
...
...
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