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
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
...
...
@@ -17,7 +17,7 @@
"__id__": 2
},
{
"__id__":
18
"__id__":
21
}
],
"_active": true,
...
...
@@ -78,22 +78,25 @@
"__id__": 5
},
{
"__id__":
6
"__id__":
8
},
{
"__id__": 8
"__id__": 9
},
{
"__id__": 11
}
],
"_active": true,
"_components": [
{
"__id__": 1
5
"__id__": 1
8
},
{
"__id__": 1
6
"__id__": 1
9
},
{
"__id__":
17
"__id__":
20
}
],
"_prefab": null,
...
...
@@ -183,7 +186,7 @@
"array": [
0,
0,
700.
831058012557
,
700.
6145516616109
,
0,
0,
0,
...
...
@@ -242,6 +245,130 @@
"_alignWithScreen": true,
"_id": "81GN3uXINKVLeW4+iKSlim"
},
{
"__type__": "cc.Node",
"_name": "New Sprite(Splash)",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 6
},
{
"__id__": 7
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 960,
"height": 640
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "c0Sa71U+xA9ZaJLf9Z1mBs"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "f9XqCBngJHUJvxJyK48DX7"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 100,
"_id": "6fZr9ziY5NrZ8GOv/50EX4"
},
{
"__type__": "cc.Node",
"_name": "bg",
...
...
@@ -311,7 +438,7 @@
"_active": true,
"_components": [
{
"__id__":
7
"__id__":
10
}
],
"_prefab": null,
...
...
@@ -367,7 +494,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
6
"__id__":
9
},
"_enabled": true,
"_materials": [
...
...
@@ -405,13 +532,13 @@
},
"_children": [
{
"__id__":
9
"__id__":
12
}
],
"_active": true,
"_components": [
{
"__id__": 1
4
"__id__": 1
7
}
],
"_prefab": null,
...
...
@@ -467,20 +594,20 @@
"_name": "Background",
"_objFlags": 512,
"_parent": {
"__id__":
8
"__id__":
11
},
"_children": [
{
"__id__": 1
0
"__id__": 1
3
}
],
"_active": true,
"_components": [
{
"__id__": 1
2
"__id__": 1
5
},
{
"__id__": 1
3
"__id__": 1
6
}
],
"_prefab": null,
...
...
@@ -536,13 +663,13 @@
"_name": "Label",
"_objFlags": 512,
"_parent": {
"__id__":
9
"__id__":
12
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1
1
"__id__": 1
4
}
],
"_prefab": null,
...
...
@@ -598,7 +725,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
0
"__id__": 1
3
},
"_enabled": true,
"_materials": [
...
...
@@ -632,7 +759,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
9
"__id__":
12
},
"_enabled": true,
"_materials": [
...
...
@@ -664,7 +791,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
9
"__id__":
12
},
"_enabled": true,
"alignMode": 0,
...
...
@@ -691,7 +818,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
8
"__id__":
11
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -764,7 +891,7 @@
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
},
"_N$target": {
"__id__":
9
"__id__":
12
},
"_id": "c1Ang3MxNBYKnmCDc6ONvQ"
},
...
...
@@ -831,19 +958,19 @@
},
"_children": [
{
"__id__":
19
"__id__":
22
},
{
"__id__": 2
4
"__id__": 2
7
},
{
"__id__":
29
"__id__":
32
},
{
"__id__": 3
4
"__id__": 3
7
},
{
"__id__":
39
"__id__":
42
}
],
"_active": true,
...
...
@@ -901,17 +1028,17 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__":
18
"__id__":
21
},
"_children": [
{
"__id__": 2
0
"__id__": 2
3
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 2
55
,
"_opacity": 2
00
,
"_color": {
"__type__": "cc.Color",
"r": 255,
...
...
@@ -963,17 +1090,17 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__":
19
"__id__":
22
},
"_children": [
{
"__id__": 2
1
"__id__": 2
4
}
],
"_active": true,
"_components": [
{
"__id__": 2
3
"__id__": 2
6
}
],
"_prefab": null,
...
...
@@ -1029,13 +1156,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 2
0
"__id__": 2
3
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
2
"__id__": 2
5
}
],
"_prefab": null,
...
...
@@ -1091,7 +1218,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
1
"__id__": 2
4
},
"_enabled": true,
"_materials": [
...
...
@@ -1123,7 +1250,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
0
"__id__": 2
3
},
"_enabled": true,
"_materials": [
...
...
@@ -1145,17 +1272,17 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__":
18
"__id__":
21
},
"_children": [
{
"__id__": 2
5
"__id__": 2
8
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 2
55
,
"_opacity": 2
00
,
"_color": {
"__type__": "cc.Color",
"r": 255,
...
...
@@ -1207,17 +1334,17 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 2
4
"__id__": 2
7
},
"_children": [
{
"__id__": 2
6
"__id__": 2
9
}
],
"_active": true,
"_components": [
{
"__id__":
28
"__id__":
31
}
],
"_prefab": null,
...
...
@@ -1273,13 +1400,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 2
5
"__id__": 2
8
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
27
"__id__":
30
}
],
"_prefab": null,
...
...
@@ -1335,7 +1462,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
6
"__id__": 2
9
},
"_enabled": true,
"_materials": [
...
...
@@ -1367,7 +1494,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
5
"__id__": 2
8
},
"_enabled": true,
"_materials": [
...
...
@@ -1389,17 +1516,17 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__":
18
"__id__":
21
},
"_children": [
{
"__id__": 3
0
"__id__": 3
3
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 2
55
,
"_opacity": 2
00
,
"_color": {
"__type__": "cc.Color",
"r": 255,
...
...
@@ -1451,17 +1578,17 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__":
29
"__id__":
32
},
"_children": [
{
"__id__": 3
1
"__id__": 3
4
}
],
"_active": true,
"_components": [
{
"__id__": 3
3
"__id__": 3
6
}
],
"_prefab": null,
...
...
@@ -1517,13 +1644,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 3
0
"__id__": 3
3
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
2
"__id__": 3
5
}
],
"_prefab": null,
...
...
@@ -1579,7 +1706,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
1
"__id__": 3
4
},
"_enabled": true,
"_materials": [
...
...
@@ -1611,7 +1738,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
0
"__id__": 3
3
},
"_enabled": true,
"_materials": [
...
...
@@ -1633,17 +1760,17 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__":
18
"__id__":
21
},
"_children": [
{
"__id__": 3
5
"__id__": 3
8
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 2
55
,
"_opacity": 2
00
,
"_color": {
"__type__": "cc.Color",
"r": 255,
...
...
@@ -1695,17 +1822,17 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 3
4
"__id__": 3
7
},
"_children": [
{
"__id__": 3
6
"__id__": 3
9
}
],
"_active": true,
"_components": [
{
"__id__":
38
"__id__":
41
}
],
"_prefab": null,
...
...
@@ -1761,13 +1888,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 3
5
"__id__": 3
8
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
37
"__id__":
40
}
],
"_prefab": null,
...
...
@@ -1823,7 +1950,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
6
"__id__": 3
9
},
"_enabled": true,
"_materials": [
...
...
@@ -1855,7 +1982,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
5
"__id__": 3
8
},
"_enabled": true,
"_materials": [
...
...
@@ -1877,17 +2004,17 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__":
18
"__id__":
21
},
"_children": [
{
"__id__": 4
0
"__id__": 4
3
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 2
55
,
"_opacity": 2
00
,
"_color": {
"__type__": "cc.Color",
"r": 255,
...
...
@@ -1939,17 +2066,17 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__":
39
"__id__":
42
},
"_children": [
{
"__id__": 4
1
"__id__": 4
4
}
],
"_active": true,
"_components": [
{
"__id__": 4
3
"__id__": 4
6
}
],
"_prefab": null,
...
...
@@ -2005,13 +2132,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 4
0
"__id__": 4
3
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
2
"__id__": 4
5
}
],
"_prefab": null,
...
...
@@ -2067,7 +2194,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
1
"__id__": 4
4
},
"_enabled": true,
"_materials": [
...
...
@@ -2099,7 +2226,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
0
"__id__": 4
3
},
"_enabled": true,
"_materials": [
...
...
play/assets/tmpGame/scene/demo_03_fireworks_2.js
View file @
ee5d68a5
...
...
@@ -38,7 +38,7 @@ cc.Class({
async
showAllFirework
(
parentNode
,
nodeList
)
{
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
);
}
},
...
...
@@ -47,16 +47,23 @@ cc.Class({
for
(
let
i
=
0
;
i
<
30
;
i
++
)
{
const
quad
=
this
.
createQuads
(
pos
,
parentNode
,
nodeList
);
const
targetX
=
RandomInt
(
width
/
2
,
-
width
/
2
);
const
targetY
=
RandomInt
(
height
);
cc
.
tween
(
quad
)
.
to
(
5
,
{
x
:
pos
.
x
+
targetX
*
7
})
.
by
(
0.5
,
{
x
:
targetX
})
.
by
(
3
,
{
x
:
targetX
*
2
})
.
start
();
cc
.
tween
(
quad
)
.
to
(
0.5
,
{
y
:
pos
.
y
+
RandomInt
(
height
)
},
{
easing
:
'
quadOut
'
})
.
to
(
2
,
{
y
:
-
parentNode
.
height
*
2
},
{
easing
:
'
quadIn
'
})
.
by
(
0.5
,
{
y
:
targetY
},
{
easing
:
'
quadOut
'
})
.
to
(
4
,
{
y
:
-
parentNode
.
height
*
2
},
{
easing
:
'
quadIn
'
})
.
removeSelf
()
.
start
();
cc
.
tween
(
quad
)
.
delay
(
1
)
.
to
(
1.5
,
{
opacity
:
0
})
.
start
();
}
},
...
...
@@ -65,13 +72,13 @@ cc.Class({
quadBase
.
x
=
pos
.
x
;
quadBase
.
y
=
pos
.
y
;
quadBase
.
z
=
pos
.
z
;
quadBase
.
angle
=
RandomInt
(
9
0
);
quadBase
.
angle
=
RandomInt
(
18
0
);
quadBase
.
parent
=
parentNode
;
const
quad
=
quadBase
.
getChildByName
(
'
quad
'
);
quad
.
x
=
0
;
quad
.
y
=
0
;
quad
.
angle
=
RandomInt
(
9
0
);
quad
.
angle
=
RandomInt
(
18
0
);
const
paper
=
quad
.
getChildByName
(
'
paper
'
);
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