#### Archived

This topic is now archived and is closed to further replies.

# Breakout physics

This topic is 5802 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I''m doing a little Breakout clone and am having trouble understanding how the ball behaves when it hits the paddle, and how a player can change the direction of the ball. For the vertical walls, I just mirror the direction of the ball on the line (1,0), and for the horizontal upper wall on (0,1). When it comes to the paddle I''ve tried to mirror on (0,1) as well, but that just doesn''t look right. I''ve tried observing the ball/paddle while playing a game and I see that if the ball hits the paddle in the center area then it seems to be reflected back through (0,1), but the angles change the farther you go from center. That, and if the paddle is moving I''m guessing it introduces spin, and therefore changes the direction and perhaps the velocity of the ball. Has anyone ever done this before or given it some thought? ------------ - outRider -

##### Share on other sites
Vertical and horizontal walls make things simple. You can only hit the left wall with a negative x component to the velocity. After the bounce the x component will be the same magnitude, opposite sign. If you hit between frames then at the end of the frame you can be left of the left wall and your correct position is the same distance right of the left wall. So you have all that worked out.

The paddle should work exactly the same if the paddle isn''t moving. If the paddle is moving then it''s velocity adds in some proportion to the velocity of the ball. If it is moving the same direction then the ball bounces at less of an angle with the horizontal. If the opposite direction then more of an angle. Those reflect adding to the x component with either the same or opposite signs. Perhaps not physically accurate, but I think it will do what you want.

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632995
• Total Posts
3009774
• ### Who's Online (See full list)

There are no registered users currently online

×