Commit 131e02f3 authored by Tt's avatar Tt

修改点击

parent bf159242
...@@ -53,10 +53,4 @@ export default class ImgVoice extends cc.Component { ...@@ -53,10 +53,4 @@ export default class ImgVoice extends cc.Component {
p2.active = false; p2.active = false;
p3.active = false; p3.active = false;
} }
} }
\ No newline at end of file
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "85bbc31f-4210-44bb-baa5-62d75887b2f3", "uuid": "2473acff-be18-403b-ada4-4bc33b00ef35",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
This diff is collapsed.
import { asyncDelay, onHomeworkFinish } from "../script/util_sn14_dds"; import { asyncDelay, onHomeworkFinish } from "../script/util_sn14_dds";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent_sn14_dds"; import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent_sn14_dds";
import pg from "./pg_sn14_dds"; import pg from "./pg_sn14_dds";
import ImgVoice from "./ImgVoice_sn14_dds"; import ImgVoice from "./Voice_sn14_dds";
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
...@@ -109,7 +109,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -109,7 +109,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.gameOver(); this.gameOver();
return; return;
} }
this.canTouch = true;
//TODO: 需要增加总倒计时 //TODO: 需要增加总倒计时
this.currentQuestion.options = this.currentQuestion.options.map((op, i) => { this.currentQuestion.options = this.currentQuestion.options.map((op, i) => {
op.id = i; op.id = i;
...@@ -155,12 +155,16 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -155,12 +155,16 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 点击泡泡 // 点击泡泡
touchPaoPao(e: any) { touchPaoPao(e: any) {
// 点击之后不能再次点击
if (!this.canTouch) return;
this.canTouch = false;
// 如果泡泡没有到指定位置不允许点击 // 如果泡泡没有到指定位置不允许点击
let item = e.target; let item = e.target;
let data = e.target.data; let data = e.target.data;
if (data.right) { if (data.right) {
this.rightList.push(data); this.rightList.push(data);
this.updatePaoPaoRight(item, data).then(() => { this.updatePaoPaoRight(item, data).then(() => {
this.canTouch = true;
if (this.rightList.length == this.currentRightList.length) { if (this.rightList.length == this.currentRightList.length) {
this.freeArea.forEach((item) => { this.freeArea.forEach((item) => {
this.udpatePaoPaoHide(item); this.udpatePaoPaoHide(item);
...@@ -173,7 +177,9 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -173,7 +177,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
} else { } else {
// 失败 // 失败
pg.hw.playLocalAudio('error') pg.hw.playLocalAudio('error')
this.updatePaoPaoError(item, data) this.updatePaoPaoError(item, data).then(() => {
this.canTouch = true;
})
} }
} }
udpatePaoPaoHide(item) { udpatePaoPaoHide(item) {
...@@ -209,17 +215,17 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -209,17 +215,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
let defaultPicY = -170; let defaultPicY = -170;
let outPicY = 105; let outPicY = 105;
cc.Tween.stopAllByTarget(bg_pic); cc.Tween.stopAllByTarget(bg_pic);
cc.tween(bg_pic).delay(1).to(1, { y: defaultPicY }).start(); cc.tween(bg_pic).delay(1 / 3).to(1 / 3, { y: defaultPicY }).start();
} else { } else {
let defaultPicY = -170; let defaultPicY = -170;
let outPicY = 80; let outPicY = 80;
cc.Tween.stopAllByTarget(bg_word); cc.Tween.stopAllByTarget(bg_word);
cc.tween(bg_word).delay(1).to(1, { y: defaultPicY }).start(); cc.tween(bg_word).delay(1 / 3).to(1 / 3, { y: defaultPicY }).start();
} }
let defaultMouseY = -110; let defaultMouseY = -110;
cc.Tween.stopAllByTarget(img_mouse); cc.Tween.stopAllByTarget(img_mouse);
cc.tween(img_mouse).delay(1).to(1, { y: defaultMouseY }).call(() => { cc.tween(img_mouse).delay(1 / 3).to(1 / 3, { y: defaultMouseY }).call(() => {
this.itemList.push(item); this.itemList.push(item);
resolve(""); resolve("");
}).start(); }).start();
......
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