Commit bf32a77e authored by limingzhe's avatar limingzhe

fix: debug

parent 01f8c8f7
......@@ -258,7 +258,13 @@ cc.Class({
.start();
await asyncDelay(0.6);
if (isDestroy) {
return;
}
await asyncTweenTo(starBig, 0.8, { scale: 0 }, { easing: 'quadOut' });
if (this.isDestroy) {
return;
}
await this.playAudioSync('question');
},
......@@ -283,7 +289,7 @@ cc.Class({
};
this.createStars();
await this.showGuns();
await this.playQuestionAudio();
this.startShowBalls();
},
......@@ -485,6 +491,9 @@ cc.Class({
}
this.speakerBlink();
await playAudioByUrlSync(currentQuestion.questionAudio);
if (this.isDestroy) {
return;
}
this.speakerStopBlink();
},
......@@ -525,6 +534,9 @@ cc.Class({
asyncTweenTo(Water, 0.1, { angle: -angle });
await asyncTweenTo(Gun, 0.1, { angle: angle, scaleY: 0.95 });
if (this.isDestroy) {
return;
}
let startPos = exchangeNodePos(bg, Muzzle);
bullet.x = startPos.x;
bullet.y = startPos.y;
......@@ -543,6 +555,10 @@ cc.Class({
scaleX: Between(0.5, 1, bullet.height / flySide.mag())
});
if (this.isDestroy) {
return;
}
bullet.setAnchorPoint(0.5, 1);
bullet.x = targetPos.x;
bullet.y = targetPos.y;
......@@ -562,7 +578,13 @@ cc.Class({
.start();
await this.playAudioSync('right');
if (this.isDestroy) {
return;
}
await playAudioByUrlSync(node.audio);
if (this.isDestroy) {
return;
}
node.removeFromParent();
},
......@@ -572,10 +594,19 @@ cc.Class({
let offsetX = RandomInt(20, 50) * 2 * (RandomInt(2) - 0.5);
let offsetY = RandomInt(20, 50) * 2 * (RandomInt(2) - 0.5);
await asyncTweenBy(node, 0.05, { x: offsetX, y: offsetY });
if (this.isDestroy) {
return;
}
offsetX = RandomInt(20, 50) * 2 * (RandomInt(2) - 0.5);
offsetY = RandomInt(20, 50) * 2 * (RandomInt(2) - 0.5);
await asyncTweenBy(node, 0.05, { x: offsetX, y: offsetY });
if (this.isDestroy) {
return;
}
await asyncTweenTo(node, 0.05, { x: x });
if (this.isDestroy) {
return;
}
},
playAudio(audioName, cb, value = 0.8) {
......@@ -602,5 +633,6 @@ cc.Class({
onDestroy() {
this.stopShowBalls();
this.isDestroy = 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