Ball and Paddle Physics: Velocity and bouncing off corners

Hi, I am trying to figure out some ball physics for a paddle and ball. I apologise if this doesn’t make much sense, my brain is frazzled and I’m just trying to get my ideas out before I go to bed.

Velocity:
(Solved, sort of)
When the ball hits the side of the paddle, I want to transfer the y velocity to the ball. The problem I am having is the mouse velocity is normally too low so I have to multiply to make it intuitive, but I want to multiply it less depending on how large the velocity is.

Also if I multiply the velocity I add when the ball hits the top, I think the ball can hit the paddle multiple times and end up going too fast.

I am thinking about having a multiplier and taking the square root of the velocity, or perhaps I will just limit the ball’s velocity.

Corner bouncing:
I calculate what side of the paddle was hit based on the angle of the ball’s from the center of the paddle.
At the moment to simulate bouncing off the corner, I check to see if the ball’s center is beyond the corner’s edge, but the edge is on the other side:

if( m_ball.y < paddleTopEdge && ( m_ball.y + Ball.RADIUS ) > paddleTopEdge
|| m_ball.y > paddleBottomEdge && ( m_ball.y + Ball.RADIUS ) < paddleBottomEdge )

The paddle is going to have a pushing motion, so it will have both x and y velocity, same as the ball.

For a less computationally intensive method, I am thinking I could conert a percentage of the balls x to y / y to x, based on how far it is off the corner.

var maxEdgeDist : Number = Ball.RADIUS;
edgeDistPercent = ( m_ball.y - paddleTopEdge ) / maxEdgeDist;

Although I suppose the less of the ball that touches the paddle, the less it might bounce off (I don’t know much about physics). If that’s the true, I suppose I could use the percentage again to reduce the overall speed.

Is this game 2D or 3D?

Also if I multiply the velocity I add when the ball hits the top, I think the ball can hit the paddle multiple times and end up going too fast.

you could do like:

if (ball is intersecting paddle && hit == false) {
  hit = true
  do whatever you do when it's hit
}

if (ball is not intersecting paddle)
  hit = false

to make it only recognize one hit each time it intersects the paddle.

Thanks for the quick replies!

The game is in 2D.

For now I have overcome the velocity problem by not using the multiplier on the top and just capping the speed (Stops anything else over-accelerating the ball anyway). I subtract the square root of the combined velocity from an average velocity and use the result to multiply the velocity if it hits the side. It’s probably not sound physics, but it works well enough!

Gonna implement the paddle’s pushing motion before I get back to the corner angles, give my brain some time to think it over. Suggestions are of course still welcome!

http://www.worsleyschool.net/science/files/reflectionlaw/page.html

this site should explain how to solve the reflection problem