Commit 7461a249 authored by LMZ's avatar LMZ

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

parent 58646637
......@@ -164,6 +164,7 @@ export class Answer {
*/
moveIn(sX, sY, toX, toY, callback = null) {
console.log(' answer move in ');
if (this.contentType == 'T') {
this.bg.x = toX;
this.bg.y = toY;
......@@ -187,6 +188,9 @@ export class Answer {
* @param callback
*/
moveOut(toX, toY, callback = null) {
console.log(' answer moveOut ');
if (this.contentType == 'T') {
this.bg.x = toX;
this.bg.y = toY;
......@@ -197,7 +201,7 @@ export class Answer {
this.bg.x = toX;
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 {
}
if (this.checkClickTarget(this.restartBtn.bg)) {
if (this.restartBtn.curStatus.alpha < 1) {
return;
}
this.canTouch = false;
this.restartBtn.click(() => {
......@@ -1069,6 +1074,8 @@ export class PlayComponent implements OnInit, OnDestroy {
showGameOver() {
console.log(" in showGameOver ");
this.canTouch = false;
this.playAudio('win');
......@@ -1141,10 +1148,21 @@ export class PlayComponent implements OnInit, OnDestroy {
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