Pong-Style Physics
Hi,
I am trying to create the calculations part for a pong-like game. The physics in the game have been really bugging me. I want it so that when it hits a wall, it bounces off at the same opposite angle. I'm in an introduction to computer science class so I don't know much advanced stuff. I will work on visually rendering the game later. Right now I want to just get it so that the calculations are working. Any ideas.
Thanks in Advance
[460 byte] By [
eboteea] at [2007-11-27 5:08:12]

> I want it so that when it hits a
> wall, it bounces off at the same opposite angle.
1) look up the math (it's not complicated). if your wall is in y-direction, the y coordinate of your velocity vector stays what it is and the x coordinate of your velocity vector gets inverted
2) implement it
> Thanks, so I should use vectors for this?if you're gonna simulate a moving ball, it's gonna have to have a (2d) position and velocity. those are vectors whether you like it or not. is nothing to do with what you would "use" for this.