Nice job guys.
Here is how I would suggest the physics works with the paddle. Note that this uses mainly math and to understand will require knowledge of vectors.
Basics:
1. All Vectors can be split into components. Often times these are 90 degress from each other (not always but usually).
2.A balls velocity is none other than the vector with components of the balls movement in the X and Y directions
3.These components, while correct, aren't what we would want (why in a second).
4.Using some geometry and trig we can find the new components in a more useful direction.
Tutorial: Bouncing Physics off of an Ellipse.
The ellipse we are working with has a width of 80 and a total height of 38. Its radii are 40 in the X direction and 19 in the Y direction.
The equations for an ellipse are as follows:
Y=CenterY+YRadius*Sin(angle)
X=CenterX+XRadius*Cos(Angle)
The first step after collision is to find the angle from the center of the paddle to the center of the ball using atanfull().
Angle#=ATANFULL(BallX-CenterX,BallY-CenterY)
Second is to find the angle which the ball is traveling at and its magnitude (strength) like so:
BallAngle#=ATANFULL(BallMoveX#,BallMoveY#)
BallMagnitude#=SQRT(BallMoveX#^2+BallMoveY#)
The third step is to set up a 'new' coordinate axis, using the angle# angle as the x axis. This is more of a mental step, but necessary.
Next, you want to break the balls movement into components along this new axis and it's Y axis.
NewBallAngle#=BallAngle#-Angle#
NewBallX#=BallMagnitude#*Cos(NewBallAngle#)
NewBallY#=BallMagnitude#*Sin(NewBallAngle#)
The X direction is simply going to be flipped (due to the normal force).
NewBallX#=NewBallX#*(-1)
Recombine the NewBallX# and NewBallY# into a magnitude and angle by doing the same stuff backwards (For the sake of laziness I will begin reusing variable names):
BallMagnitude#=SQRT(NewBallX#^2+NewBallY#^2)
BallAngle#=ATANFULL(NewBallX#,NewBallY#)
RealAngle#=BallAngle#+Angle# : REM This is the original Angle# variable)
BallMoveX#=BallMagnitude#*Cos(RealAngle#)
BallMoveY#=BallMagnitude#*Sin(RealAngle#)
Viola! I will try to draw up some pics to help illustrate it if you want, don't know if I will be able to get em up tonight though. Let me know if I can clarify anything. If you are having trouble picturing it, try to follow the math with a ball hitting the very top dropping straight down (it would bounce straight back up).
Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose