Commit ee5d68a5 authored by 范雪寒's avatar 范雪寒

feat: 调整撒花效果

parent 5a6afb6e
......@@ -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__": 15
"__id__": 18
},
{
"__id__": 16
"__id__": 19
},
{
"__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__": 14
"__id__": 17
}
],
"_prefab": null,
......@@ -467,20 +594,20 @@
"_name": "Background",
"_objFlags": 512,
"_parent": {
"__id__": 8
"__id__": 11
},
"_children": [
{
"__id__": 10
"__id__": 13
}
],
"_active": true,
"_components": [
{
"__id__": 12
"__id__": 15
},
{
"__id__": 13
"__id__": 16
}
],
"_prefab": null,
......@@ -536,13 +663,13 @@
"_name": "Label",
"_objFlags": 512,
"_parent": {
"__id__": 9
"__id__": 12
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 11
"__id__": 14
}
],
"_prefab": null,
......@@ -598,7 +725,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
"__id__": 13
},
"_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__": 24
"__id__": 27
},
{
"__id__": 29
"__id__": 32
},
{
"__id__": 34
"__id__": 37
},
{
"__id__": 39
"__id__": 42
}
],
"_active": true,
......@@ -901,17 +1028,17 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__": 18
"__id__": 21
},
"_children": [
{
"__id__": 20
"__id__": 23
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_opacity": 200,
"_color": {
"__type__": "cc.Color",
"r": 255,
......@@ -963,17 +1090,17 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 19
"__id__": 22
},
"_children": [
{
"__id__": 21
"__id__": 24
}
],
"_active": true,
"_components": [
{
"__id__": 23
"__id__": 26
}
],
"_prefab": null,
......@@ -1029,13 +1156,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 20
"__id__": 23
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 22
"__id__": 25
}
],
"_prefab": null,
......@@ -1091,7 +1218,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 21
"__id__": 24
},
"_enabled": true,
"_materials": [
......@@ -1123,7 +1250,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 20
"__id__": 23
},
"_enabled": true,
"_materials": [
......@@ -1145,17 +1272,17 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__": 18
"__id__": 21
},
"_children": [
{
"__id__": 25
"__id__": 28
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_opacity": 200,
"_color": {
"__type__": "cc.Color",
"r": 255,
......@@ -1207,17 +1334,17 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 24
"__id__": 27
},
"_children": [
{
"__id__": 26
"__id__": 29
}
],
"_active": true,
"_components": [
{
"__id__": 28
"__id__": 31
}
],
"_prefab": null,
......@@ -1273,13 +1400,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 25
"__id__": 28
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 27
"__id__": 30
}
],
"_prefab": null,
......@@ -1335,7 +1462,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 26
"__id__": 29
},
"_enabled": true,
"_materials": [
......@@ -1367,7 +1494,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
"__id__": 28
},
"_enabled": true,
"_materials": [
......@@ -1389,17 +1516,17 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__": 18
"__id__": 21
},
"_children": [
{
"__id__": 30
"__id__": 33
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_opacity": 200,
"_color": {
"__type__": "cc.Color",
"r": 255,
......@@ -1451,17 +1578,17 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 29
"__id__": 32
},
"_children": [
{
"__id__": 31
"__id__": 34
}
],
"_active": true,
"_components": [
{
"__id__": 33
"__id__": 36
}
],
"_prefab": null,
......@@ -1517,13 +1644,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 30
"__id__": 33
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 32
"__id__": 35
}
],
"_prefab": null,
......@@ -1579,7 +1706,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 31
"__id__": 34
},
"_enabled": true,
"_materials": [
......@@ -1611,7 +1738,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 30
"__id__": 33
},
"_enabled": true,
"_materials": [
......@@ -1633,17 +1760,17 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__": 18
"__id__": 21
},
"_children": [
{
"__id__": 35
"__id__": 38
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_opacity": 200,
"_color": {
"__type__": "cc.Color",
"r": 255,
......@@ -1695,17 +1822,17 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 34
"__id__": 37
},
"_children": [
{
"__id__": 36
"__id__": 39
}
],
"_active": true,
"_components": [
{
"__id__": 38
"__id__": 41
}
],
"_prefab": null,
......@@ -1761,13 +1888,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 35
"__id__": 38
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 37
"__id__": 40
}
],
"_prefab": null,
......@@ -1823,7 +1950,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 36
"__id__": 39
},
"_enabled": true,
"_materials": [
......@@ -1855,7 +1982,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 35
"__id__": 38
},
"_enabled": true,
"_materials": [
......@@ -1877,17 +2004,17 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__": 18
"__id__": 21
},
"_children": [
{
"__id__": 40
"__id__": 43
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_opacity": 200,
"_color": {
"__type__": "cc.Color",
"r": 255,
......@@ -1939,17 +2066,17 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 39
"__id__": 42
},
"_children": [
{
"__id__": 41
"__id__": 44
}
],
"_active": true,
"_components": [
{
"__id__": 43
"__id__": 46
}
],
"_prefab": null,
......@@ -2005,13 +2132,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 40
"__id__": 43
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 42
"__id__": 45
}
],
"_prefab": null,
......@@ -2067,7 +2194,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 41
"__id__": 44
},
"_enabled": true,
"_materials": [
......@@ -2099,7 +2226,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 40
"__id__": 43
},
"_enabled": true,
"_materials": [
......
......@@ -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(90);
quadBase.angle = RandomInt(180);
quadBase.parent = parentNode;
const quad = quadBase.getChildByName('quad');
quad.x = 0;
quad.y = 0;
quad.angle = RandomInt(90);
quad.angle = RandomInt(180);
const paper = quad.getChildByName('paper');
paper.scaleX = Math.random() * 0.5 + 0.5;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment