Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
unit_demo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
unit_demo
Commits
ee5d68a5
Commit
ee5d68a5
authored
Mar 30, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 调整撒花效果
parent
5a6afb6e
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
217 additions
and
83 deletions
+217
-83
demo_03_fireworks_2.fire
play/assets/tmpGame/scene/demo_03_fireworks_2.fire
+204
-77
demo_03_fireworks_2.js
play/assets/tmpGame/scene/demo_03_fireworks_2.js
+13
-6
No files found.
play/assets/tmpGame/scene/demo_03_fireworks_2.fire
View file @
ee5d68a5
This diff is collapsed.
Click to expand it.
play/assets/tmpGame/scene/demo_03_fireworks_2.js
View file @
ee5d68a5
...
@@ -38,7 +38,7 @@ cc.Class({
...
@@ -38,7 +38,7 @@ cc.Class({
async
showAllFirework
(
parentNode
,
nodeList
)
{
async
showAllFirework
(
parentNode
,
nodeList
)
{
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
this
.
showFirework
(
cc
.
v2
(
0
,
-
parentNode
.
height
/
2
),
parentNode
,
nodeList
,
parentNode
.
width
*
1
,
parentNode
.
height
*
2
);
this
.
showFirework
(
cc
.
v2
(
0
,
-
parentNode
.
height
/
2
),
parentNode
,
nodeList
,
parentNode
.
width
*
2
/
3
,
parentNode
.
height
*
1.3
);
await
asyncDelay
(
0.1
);
await
asyncDelay
(
0.1
);
}
}
},
},
...
@@ -47,16 +47,23 @@ cc.Class({
...
@@ -47,16 +47,23 @@ cc.Class({
for
(
let
i
=
0
;
i
<
30
;
i
++
)
{
for
(
let
i
=
0
;
i
<
30
;
i
++
)
{
const
quad
=
this
.
createQuads
(
pos
,
parentNode
,
nodeList
);
const
quad
=
this
.
createQuads
(
pos
,
parentNode
,
nodeList
);
const
targetX
=
RandomInt
(
width
/
2
,
-
width
/
2
);
const
targetX
=
RandomInt
(
width
/
2
,
-
width
/
2
);
const
targetY
=
RandomInt
(
height
);
cc
.
tween
(
quad
)
cc
.
tween
(
quad
)
.
to
(
5
,
{
x
:
pos
.
x
+
targetX
*
7
})
.
by
(
0.5
,
{
x
:
targetX
})
.
by
(
3
,
{
x
:
targetX
*
2
})
.
start
();
.
start
();
cc
.
tween
(
quad
)
cc
.
tween
(
quad
)
.
to
(
0.5
,
{
y
:
pos
.
y
+
RandomInt
(
height
)
},
{
easing
:
'
quadOut
'
})
.
by
(
0.5
,
{
y
:
targetY
},
{
easing
:
'
quadOut
'
})
.
to
(
2
,
{
y
:
-
parentNode
.
height
*
2
},
{
easing
:
'
quadIn
'
})
.
to
(
4
,
{
y
:
-
parentNode
.
height
*
2
},
{
easing
:
'
quadIn
'
})
.
removeSelf
()
.
removeSelf
()
.
start
();
.
start
();
cc
.
tween
(
quad
)
.
delay
(
1
)
.
to
(
1.5
,
{
opacity
:
0
})
.
start
();
}
}
},
},
...
@@ -65,13 +72,13 @@ cc.Class({
...
@@ -65,13 +72,13 @@ cc.Class({
quadBase
.
x
=
pos
.
x
;
quadBase
.
x
=
pos
.
x
;
quadBase
.
y
=
pos
.
y
;
quadBase
.
y
=
pos
.
y
;
quadBase
.
z
=
pos
.
z
;
quadBase
.
z
=
pos
.
z
;
quadBase
.
angle
=
RandomInt
(
9
0
);
quadBase
.
angle
=
RandomInt
(
18
0
);
quadBase
.
parent
=
parentNode
;
quadBase
.
parent
=
parentNode
;
const
quad
=
quadBase
.
getChildByName
(
'
quad
'
);
const
quad
=
quadBase
.
getChildByName
(
'
quad
'
);
quad
.
x
=
0
;
quad
.
x
=
0
;
quad
.
y
=
0
;
quad
.
y
=
0
;
quad
.
angle
=
RandomInt
(
9
0
);
quad
.
angle
=
RandomInt
(
18
0
);
const
paper
=
quad
.
getChildByName
(
'
paper
'
);
const
paper
=
quad
.
getChildByName
(
'
paper
'
);
paper
.
scaleX
=
Math
.
random
()
*
0.5
+
0.5
;
paper
.
scaleX
=
Math
.
random
()
*
0.5
+
0.5
;
...
...
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