Commit 3a4a1234 authored by Tt's avatar Tt

重复点击遮挡增加

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