Commit 8424e16d authored by Tt's avatar Tt

处理弹跳问题

parent 0e431797
...@@ -81,13 +81,13 @@ ...@@ -81,13 +81,13 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 71 "__id__": 69
}, },
{ {
"__id__": 72 "__id__": 70
}, },
{ {
"__id__": 73 "__id__": 71
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2797,9 +2797,6 @@ ...@@ -2797,9 +2797,6 @@
}, },
{ {
"__id__": 67 "__id__": 67
},
{
"__id__": 69
} }
], ],
"_active": true, "_active": true,
...@@ -3257,87 +3254,6 @@ ...@@ -3257,87 +3254,6 @@
"preload": false, "preload": false,
"_id": "37cyjPdPZJwLJb8wO/owRL" "_id": "37cyjPdPZJwLJb8wO/owRL"
}, },
{
"__type__": "cc.Node",
"_name": "countdown",
"_objFlags": 0,
"_parent": {
"__id__": 58
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 70
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_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": "485or6pMBN4aoRx0UyuEjN"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 69
},
"_enabled": true,
"_clip": {
"__uuid__": "d8ef57d2-fa60-4d7d-84c9-793550fd2332"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"_firstlyEnabled": true,
"playOnLoad": false,
"preload": false,
"_id": "98aghKsehBmbwQ9VHEWzDn"
},
{ {
"__type__": "cc.Canvas", "__type__": "cc.Canvas",
"_name": "", "_name": "",
......
...@@ -174,7 +174,6 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -174,7 +174,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
layer_paopao.addChild(item) layer_paopao.addChild(item)
this.updatePaoPao(item, data, pos, i); this.updatePaoPao(item, data, pos, i);
} }
pg.hw.playLocalAudio('fly')
this.scheduleOnce(() => { this.scheduleOnce(() => {
this.canTouch = true; this.canTouch = true;
}, 2) }, 2)
...@@ -219,12 +218,25 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -219,12 +218,25 @@ export default class SceneComponent extends MyCocosSceneComponent {
let time = i == 1 ? 1.3 : i == 2 ? 1.6 : 2;// let time = i == 1 ? 1.3 : i == 2 ? 1.6 : 2;//
cc.tween(item) cc.tween(item)
.to(time, { y: pos.y }) .to(time, { y: pos.y })
.to(0.3, { scaleY: 1.1, y: pos.y + 50 })
.to(0.3, { scaleY: 1, y: pos.y })
.call(() => { .call(() => {
this.repeatFly(item)
}).start(); }).start();
} }
repeatFly(item) {
cc.tween(item)
.repeatForever(
cc.tween()
.call(() => {
pg.hw.playLocalAudio('fly')
})
.to(0.5, { scaleY: 1.1, y: 60 })
.to(0.5, { scaleY: 1, y: 0 })
.delay(0.7)
).start();
}
stopFly(item) {
cc.Tween.stopAllByTarget(item);
}
// 点击泡泡 // 点击泡泡
touchPaoPao(e: any) { touchPaoPao(e: any) {
if (!this.canTouch) return; if (!this.canTouch) return;
...@@ -268,10 +280,12 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -268,10 +280,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg.view.visible(broken, true) pg.view.visible(broken, true)
// 处理闪电效果 // 处理闪电效果
broken.getComponent(ImgVoice).playVoiceStart(); broken.getComponent(ImgVoice).playVoiceStart();
this.stopFly(item);
pg.hw.playLocalAudio('error').then(() => { pg.hw.playLocalAudio('error').then(() => {
broken.getComponent(ImgVoice).playVoiceEnd(); broken.getComponent(ImgVoice).playVoiceEnd();
pg.view.visible(bubble, true) pg.view.visible(bubble, true)
pg.view.visible(broken, false) pg.view.visible(broken, false)
this.repeatFly(item);
}) })
} }
} }
......
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