   Collision Detection Questions (PONG)
  Well after many months of learning different aspects of programming and graphics i started on a Pong clone and well im mostly finished.It was written with C++ and Direct Draw, and now im working on implementing Direct Input. Now i have several questions about collision detection. Now i came up with an algorithm that does collision detection but i think its a bit ineficient. the way i did it was first checking if the ball.x equaled paddle.x if it did then i checked wether the ball.y was greater than or less than paddle.y and if the ball.y + ball.size was equivalent to the paddle.y + paddle.height and i sort of modified that for all the sides of the paddles and then if it checked out i reversed the velocity of the ball modified it to the movement of the paddle. the  problem is i will accelerate the ball over time to make it harder but if the ball gets too fast it will go right thru the paddle. Now if anyone could explain to me any better collision detection algorithms that would be great. 
  << but if the ball gets too fast it will go right thru the paddle >>Assuming your paddles are on the far left and far right, simply STOP the x position of the ball right before it touches the paddle, so no matter how fast the ball moves (1, 3, 5, 9, or 15 pixels a frame), you check if the ball is "out of bounds" (i.e. past the paddle) and force the ball to the pixel right BEFORE the paddle. THEN make your check on Y to see if the ball hit the paddle. That''s how I would do it, and how I did it in my breakout (with paddle at the bottom of the screen).Problems could arise if you allowed the player to move his paddle both up/down AND left/right. But if paddle movement is just up/down then stopping the ball on x just before the paddle and then checking the y position for collision solves the "through the paddle" problem.Phil P ;  great thats good ill have to check that out thanks Vaz 