Commit 86acd211 authored by wildfirecode's avatar wildfirecode

1

parent dded310c
...@@ -352,11 +352,7 @@ export default class PlayScene extends Scene { ...@@ -352,11 +352,7 @@ export default class PlayScene extends Scene {
time = detaX < 1 ? 1 : detaX; time = detaX < 1 ? 1 : detaX;
targX = LEFT_GROUND - BALL_D; targX = LEFT_GROUND - BALL_D;
} }
// console.log(targX) ball.view.alpha=0.80;
// 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,
...@@ -365,17 +361,31 @@ export default class PlayScene extends Scene { ...@@ -365,17 +361,31 @@ export default class PlayScene extends Scene {
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) // 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: 313.4 - 100, y: 313.4 - 100,
useFrame: true, useFrame: true,
onComplete: () => { onComplete: () => {
Tween.to(ball.view, 30, { const middlex = 375;
const p0 = { x: ball.view.x, y: ball.view.y };
const p1 = { x: (ball.view.x + middlex) / 2, y: ball.view.y - 500 };
const p2 = { x: middlex, y: ball.view.y };
Tween.to(ball.view, 20, {
useFrame: true, useFrame: true,
__xx__: 100, __xx__: 100,
onUpdate: (per) => { onUpdate: (value) => {
ball.view.x += vx; ball.view.x = (1 - value) * (1 - value) * p0.x + 2 * value * (1 - value) * p1.x + value * value * p2.x;
console.log(per); ball.view.y = (1 - value) * (1 - value) * p0.y + 2 * value * (1 - value) * p1.y + value * value * p2.y;
console.log(value);
},
onComplete: () => {
this.data.currentBallNums++;
this.ballCount++;
ball.view.visible = false;
ball.view.alpha=1;
if (this.ballCount == this.ballCountAll) {
this.canShootTag = true;
this.onShootEnd();
}
} }
}) })
// ball.view.visible = false; // ball.view.visible = false;
......
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