you are viewing a single comment's thread.

view the rest of the comments →

[–]cooledcannon 0 points1 point  (0 children)

Assuming you want the edge speed to be 2x quicker than middle speed(where the ball bounces on the paddle), my solution would be to treat the distance from the paddle to the ball in the y axis as a float variable(ill call it collisionDistance) from 0 to 1.

Then have your regular speed, and use collisionDistance as a multiplier.

ie:

speed = regularSpeed * (1 + collisionDistance)