• Create Account

### #ActualBacterius

Posted 24 October 2012 - 09:00 AM

You could consider your paddle as a rectangle with two half circles at the ends. Then find out what the ball hits and perform collision response accordingly (for the rectangle, reflect the velocity about the surface normal, for the half circles do the same but the normal depends on the location the ball hit - and this'll make the ball bounce off at different angles if it hits the edges of the paddle). Though this kind of design can't really be shoehorned in the typical "if ball position is less than zero do such and such" type of code - you'd need to start from scratch and define actual objects, run correct intersection loops, etc..

### #1Bacterius

Posted 24 October 2012 - 08:58 AM

You could consider your paddle as a rectangle with two half circles at the ends. Then find out what the ball hits and perform collision response accordingly (for the rectangle, reflect the velocity about the surface normal, for the half circles do the same but the normal depends on the location the ball hit - and this'll make the ball bounce off at different angles if it hits the edges of the paddle).

PARTNERS