Commit 3f440434 authored by Tt's avatar Tt

处理快速点击

parent 878a08e4
......@@ -60,6 +60,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
private audioId: any;
onTouchVoice() {
if (this.isEnding) return;
if (!this.canTouch) return;
if (this.audioId) {
cc.audioEngine.stopEffect(this.audioId);
......@@ -105,7 +106,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
})
}
private isEnding: boolean;
gameOver() {
this.isEnding = true;
this.sendData(this.data.questions.length * 3).then(() => {
const middleLayer = cc.find('middleLayer').getComponent('middleLayer');
middleLayer.saveGolds(this.data.questions.length * 3); // 保存金币数量;num 是获得金币的数量,数字类型;
......@@ -237,6 +240,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
// 点击泡泡
touchPaoPao(e: any) {
if (this.isEnding) return;
if (!this.canTouch) return;
this.canTouch = false;
// 如果泡泡没有到指定位置不允许点击
......@@ -263,7 +267,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
children.forEach((node, i) => {
if (this.rightList.some(dt => node.data.id == dt.id)) return;
cc.Tween.stopAllByTarget(node);
cc.tween(node).by(0.5 + (i / children.length) * 0.5, { y: -1500 }).start();
cc.tween(node).by(0.5 + (i / children.length) * 0.5, { y: -1500 }).call(() => {
node.active = false;
}).start();
})
}
this.scheduleOnce(() => {
......@@ -287,7 +293,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg.view.visible(bubble, true)
pg.view.visible(broken, false)
this.repeatFly(item);
this.canTouch = true;
this.scheduleOnce(() => {
this.canTouch = true;
}, 0.1)
})
}
}
......
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