Commit 3a4a1234 authored by Tt's avatar Tt

重复点击遮挡增加

parent e1791029
This diff is collapsed.
......@@ -64,6 +64,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg.view.touchOn(this.btn_megaphone, this.onTouchMegaphone, this)
}
onTouchMegaphone() {
if (this.gameOverEnd) return;
if (!this.startCreate) return;
//发音
cc.audioEngine.stopAllEffects();
......@@ -86,6 +87,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
sendData(score) {
return new Promise(res => {
if (!cc.find('middleLayer')) return;
let upData: any = {
word_count: this.data.word_count || 0,
sentence_count: this.data.sentence_count || 0,
......@@ -104,16 +106,16 @@ export default class SceneComponent extends MyCocosSceneComponent {
})
}
private gameOverEnd: boolean;
gameOver() {
// pg.event.once('layer_ending_touch_replay', () => {
// this.replay();
// })
// pg.event.emit('layer_ending_show', { coin: this.data.questions.length * 3 })
if (this.gameOverEnd) return;
this.gameOverEnd = true;
if (!cc.find('middleLayer')) return;
this.sendData(this.data.questions.length * 3).then(() => {
})
const middleLayer = cc.find('middleLayer').getComponent('middleLayer');
middleLayer.saveGolds(this.data.questions.length * 3); // 保存金币数量;num 是获得金币的数量,数字类型;
middleLayer.goNextPage(); // 跳转到下一页
})
}
private rightList: Array<any>;
private createCount: number;
......@@ -201,6 +203,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 点击泡泡
private touchForid: boolean;
touchPaoPao(e: any) {
console.log(this.gameOverEnd);
if (this.gameOverEnd) return;
if (this.touchForid) return;
this.touchForid = true;
// 如果泡泡没有到指定位置不允许点击
......
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