Pong Collision
Posted: Wed Apr 22, 2009 2:35 pm
I've nearly finished my first pong clone and only have a few more things I'd like to do with it. One of them is to make it have better collision.
Currently I'm just checking whether there is a collision and reversing the x-velocity, but I want to have it so that different things can affect what happens to the ball such as where on the paddle it hits and which direction the paddle is moving in.
I'm thinking maybe changing the yVelocity depending on how far away from the center of the paddle the ball hits and also adding a portion of the paddle's y-velocity to the balls.
But I'd appreciate some ideas from people on other ways I could do this.
Currently I'm just checking whether there is a collision and reversing the x-velocity, but I want to have it so that different things can affect what happens to the ball such as where on the paddle it hits and which direction the paddle is moving in.
I'm thinking maybe changing the yVelocity depending on how far away from the center of the paddle the ball hits and also adding a portion of the paddle's y-velocity to the balls.
But I'd appreciate some ideas from people on other ways I could do this.