Commit dded310c authored by wildfirecode's avatar wildfirecode

1

parent 31315b6d
...@@ -353,6 +353,10 @@ export default class PlayScene extends Scene { ...@@ -353,6 +353,10 @@ export default class PlayScene extends Scene {
targX = LEFT_GROUND - BALL_D; targX = LEFT_GROUND - BALL_D;
} }
// console.log(targX) // console.log(targX)
// const { p0, p1, p2 } = this;
// this.bullet.x = (1 - value) * (1 - value) * p0.x + 2 * value * (1 - value) * p1.x + value * value * p2.x;
// this.bullet.y = (1 - value) * (1 - value) * p0.y + 2 * value * (1 - value) * p1.y + value * value * p2.y;
Tween.to(ball.view, time, { Tween.to(ball.view, time, {
x: targX, x: targX,
y: 1155, y: 1155,
...@@ -360,24 +364,34 @@ export default class PlayScene extends Scene { ...@@ -360,24 +364,34 @@ export default class PlayScene extends Scene {
onComplete: () => { onComplete: () => {
ball.view.x = targX; ball.view.x = targX;
playSound(SoundType.recover); playSound(SoundType.recover);
// console.log( this.line.y - this.line.anchorOffsetY + BALL_D / 2)
const vx = (ball.view.x > 375 ? -1 : 1) * 11;
Tween.to(ball.view, 20, { Tween.to(ball.view, 20, {
y: this.line.y - this.line.anchorOffsetY + BALL_D / 2, y: 313.4 - 100,
useFrame: true, useFrame: true,
onComplete: () => { onComplete: () => {
ball.view.visible = false; Tween.to(ball.view, 30, {
Tween.to(ball.view, 15, {
x: this.line.x,
useFrame: true, useFrame: true,
onComplete: () => { __xx__: 100,
this.data.currentBallNums++; onUpdate: (per) => {
this.ballCount++; ball.view.x += vx;
console.log(per);
if (this.ballCount == this.ballCountAll) {
this.canShootTag = true;
this.onShootEnd();
}
} }
}) })
// ball.view.visible = false;
// Tween.to(ball.view, 15, {
// x: this.line.x,
// useFrame: true,
// onComplete: () => {
// this.data.currentBallNums++;
// this.ballCount++;
// if (this.ballCount == this.ballCountAll) {
// this.canShootTag = true;
// this.onShootEnd();
// }
// }
// })
} }
}) })
} }
......
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