Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I'm creating a game (Breakout) that involves a paddle and ball. I'm having trouble calculating the direction that I should send the ball after collision with the paddle.

Currently, upon collision I've reversed the Y velocity of the ball so it gets sent upwards, but if, for example, it hits the left side of the paddle and the paddle is moving to the left, how would I know where to send the ball? I'm not sure how to calculate this.

I want the user to have more control over where the ball goes instead of just reversing the Y velocity - this just keeps the ball going in a constant square.

share|improve this question
1  
This is probably more adapted to physics.SE. You should use the conservation laws like conservation of (kinetic) energy and conservation of momentum. Maybe have a look first at Wikipedia. –  Tom-Tom Apr 17 at 12:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.