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|C++.com|MSDN]
[edited by - Charles Hwang on October 9, 2003 5:49:43 PM]
Ball physics and collision detection
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)
Uhh, yeah, that''d work pretty well I think...I don''t see why you couldn''t just try something this simple and see for yourself.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement