Ping Pong

I wanted to know the basics of making a ping pong game. the catch is, you don’t control anything. it plays itself.

The only reason why I ask for such a thing it to learn the guts of stuff and how it works.

If anyone can help with this please let me know, Thank you.

It’s probably more difficult to make the game play itself than to have human players (unless the ball moves on a fixed or predictable path, you will need some AI to control the paddles).

As for the basic game mechanics, you could handle the movement of the ball in two basic ways: animating it yourself and using the physics engine. Using physics will save you having to calculate what happens during collisions yourself. However, it may actually be too realistic depending on what you want to do. You may need to constrain the physics to create a more straightforward pong game. Animating the ball yourself will involve simulating the collisions, calculating the angles, etc, but you do have full control over the motion. The approach you choose is largely down to the particular look and feel you are aiming for and also whether you find the physics or scripted animation easier.