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


Ball physics and collision detection

Recommended Posts

I am thinking about doing my ball physics and collision detection for pong as follows. I would have a xvec and yvec (direction) vector which would work like this. The starting velocity of a ball would be x=-1, and y=1 (after making the prototype work, I would probably make the start of the game set these values with a random seed/number). So, using the cartestian coordinate system, I would loop it like this and expect to move the ball like this: Would the basic collision stuff check and work out correctly? (pseudocode)
if(y-3>screenHeightMin && y+3paddleFront && x+3                   

Charles Hwang -Also/Previously known as Tazel Personal >>[MonkeyHumor-Under Developement | E-mail] Programming >>[NeXe|NeHe|SDL] Resource >>[Google|Dev-C++|GDArticles||MSDN] [edited by - Charles Hwang on October 9, 2003 5:49:43 PM]

Share this post

Link to post
Share on other sites