Commit 7461a249 authored by LMZ's avatar LMZ

fix: 重玩按钮 隐藏还能点击; 重玩后图片消失

parent 58646637
...@@ -164,6 +164,7 @@ export class Answer { ...@@ -164,6 +164,7 @@ export class Answer {
*/ */
moveIn(sX, sY, toX, toY, callback = null) { moveIn(sX, sY, toX, toY, callback = null) {
console.log(' answer move in ');
if (this.contentType == 'T') { if (this.contentType == 'T') {
this.bg.x = toX; this.bg.x = toX;
this.bg.y = toY; this.bg.y = toY;
...@@ -187,6 +188,9 @@ export class Answer { ...@@ -187,6 +188,9 @@ export class Answer {
* @param callback * @param callback
*/ */
moveOut(toX, toY, callback = null) { moveOut(toX, toY, callback = null) {
console.log(' answer moveOut ');
if (this.contentType == 'T') { if (this.contentType == 'T') {
this.bg.x = toX; this.bg.x = toX;
this.bg.y = toY; this.bg.y = toY;
...@@ -197,7 +201,7 @@ export class Answer { ...@@ -197,7 +201,7 @@ export class Answer {
this.bg.x = toX; this.bg.x = toX;
this.bg.y = toY; this.bg.y = toY;
tweenChange(this.contentSprite, { alpha: 0 }, 0.3, callback); tweenChange(this.contentSprite, {alpha: 0 }, 0.3, callback);
} }
} }
......
...@@ -928,6 +928,11 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -928,6 +928,11 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
if (this.checkClickTarget(this.restartBtn.bg)) { if (this.checkClickTarget(this.restartBtn.bg)) {
if (this.restartBtn.curStatus.alpha < 1) {
return;
}
this.canTouch = false; this.canTouch = false;
this.restartBtn.click(() => { this.restartBtn.click(() => {
...@@ -1069,6 +1074,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1069,6 +1074,8 @@ export class PlayComponent implements OnInit, OnDestroy {
showGameOver() { showGameOver() {
console.log(" in showGameOver ");
this.canTouch = false; this.canTouch = false;
this.playAudio('win'); this.playAudio('win');
...@@ -1141,10 +1148,21 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1141,10 +1148,21 @@ export class PlayComponent implements OnInit, OnDestroy {
showCelebrate(); showCelebrate();
}); });
//将答案滑出屏幕 //将答案滑出屏幕
this.leftBox.moveOut();
this.midBox.moveOut(); let lastAnswer1 = this.rightBox.answer;
this.rightBox.hide(lastAnswer1);
let lastAnswer2 = this.midBox.answer;
this.midBox.hide(lastAnswer2);
let lastAnswer3 = this.leftBox.answer;
this.leftBox.hide(lastAnswer3);
// this.leftBox.moveOut();
// this.midBox.moveOut();
this.rightBox.moveOut(); // this.rightBox.moveOut();
} }
} }
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