I imagine you could make a physics engine object that you update continuously at given time intervals. It would check for collisions, move the ball, compute bounce angles, etc.
EDIT #1: To add a little more detail, the "game physics" object would store, among other things, references to other game objects like the ball and paddles. The game physics object would have an "update" method that would be called continuously as the game runs. Some of the steps this method would perform are:
- Get the current position of the paddles (which are controlled by the players).
- Update the position of the ball based on its previous speed and direction and the time that has elapsed since the last update.
- Detect collisions with other objects (paddles, walls, etc.).
- Recompute the speed and direction of the ball based on any collisions.
Just a few ideas.
EDIT #2: To elaborate with a bit more of an OO focus...
The various physical objects, like the ball and paddles, would store innate physical states and parameters for themselves (position, speed, mass, etc.) as properties. The game physics object would essentially represent all of the equations of physical motion as methods.
As an example... Let's say you want to model the effects of air friction on the ball. The ball object would store properties such as "velocity" and "drag coefficient". The game physics object would have a method for computing the force of air resistance on an object by fetching the necessary properties of that object and plugging them in to a given equation of fluid drag.
By encapsulating things in this way, updates to the code can be easier. For instance, if you want to use a different equation for fluid drag, the only modification you need to make is to the appropriate method of the game physics object. None of the other objects need to be modified.