Pong game design


#1

I’m quite new to object-oriented programming, and I would really like some advice on how to structure a Pong clone I’m making. I’ve made one Pong already, but the code was really messy, and I’d like to remake it so it’d be more structured.

   My first Pong looked like this:
   
   [b]CPad[/b] - A class which handles pads. I made two objects from this class, [i]Player1[/i] and [i]Player2[/i]. This class handled the pad's size, speed, etc.
   
   [b]CBall[/b] - A class which handles balls. For each new ball that appears on the screen, a new object from the [i]CBall[/i] class is created. I thought in case I need several balls for a game (like a Breakout clone) it'd be smart controlling the ball with a class.

I tried to come up with more ways of dividing the game into smaller pieces, but I’m afraid I don’t really know how to proceed from this. Is there a better way of structuring a Pong? Do I need more classes for handling collision, etc?

   Any help is much appreciated.

#2

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.