pong

Started by
2 comments, last by cpp boy 21 years, 9 months ago
Im searching the equation of bouncing in the game pong and if possible a example of it in c++ or vb Kevin
Kevin
Advertisement
Kevin,

Please visit this other recent thread on the subject of Pong collisions:

www.gamedev.net/community/forums/topic.asp?topic_id=102460

Perhaps it will have the answer you are looking for, .

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
if(ball.x>=SCREEN_WIDTH)
{
ball.dx =-ball.dx; // dx is the ball''s direction on the x axis
}

//bla...

if(ball hits paddle)
{
if(KEYDOWN(VK_DOWN)) // add downward spin
{
ball.dx+= ball.spin; // you don''t have to change ball direction, it was changed above ^
}
}

//bla, do this for the other directions, etc

Hope that helped

- Jesse Barksdale
Thanks
just flip the angle around, but thats a simple way...

This topic is closed to new replies.

Advertisement