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

feat: 调整撒花效果

parent 5a6afb6e
...@@ -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(90); quadBase.angle = RandomInt(180);
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(90); quad.angle = RandomInt(180);
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;
......
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