Jump to content
Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 06 October 2012 - 09:14 AM
Posted 06 October 2012 - 11:24 AM
Posted 06 October 2012 - 12:27 PM
Hi I read your post and I think I can help. But first I need to know:
How do you want your game to look like?
Are you aiming for the absolute simplest version(the ball updates 1-5 times a second), or the more modern version(the ball have a fluid motion)?
Is the ball round or square?
What happens if it hits a corner of the paddle?
Posted 06 October 2012 - 01:36 PM
Edited by Lars-Kristian, 06 October 2012 - 01:51 PM.
Posted 06 October 2012 - 01:49 PM
If you have a basic understanding about vectors this link will help you a lot:
Under the "calculating the projection vector" section.
1. Find the the smallest projection vector.
2. Move the ball on the outside of the paddle.(The length of the projection vector)
3. Reverse the acceleration of the ball in the direction of the collision.
Note: It can also be useful too not allow movement of the paddle if the ball hits the top or bottom side of the paddle, so that the ball and paddle does not collide 2 time in a row.
This is not the simplest method to find the collision, but it is very useful when it comes to collision handling.
If this does not make sense, please let me know. xD
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.