Original Post
I''m Making a pong game and i cant figure out how to make the ball reverse its velocity when it hits the paddle im using GDI and here''s what i have been trying...
/////////////////////////////////////////////////////////////////
if (ball_y > PADDLE_HEIGHT && ball_y < WINDOW_HEIGHT &&
ball_y == paddle_y && ball_x == paddle_x)
{
ball_xv = -ball_vx;
}
/////////////////////////////////////////////////////////////////
Ok i know i need to explain some of my variables...
ball_y = the ball y axis
ball_x = take a wild guess
paddle_y = the height of the paddle (its on the bottom of the screen)
paddle_x = the axis the paddle moves on
ball_xv= the velocity of the ball going on the x axis
ball_yv= the velocity of the ball going on the y axis
Does anyone know how to help me???
IceMage
