Chapter 6: Object-Oriented Programming – Starting the Pong Game
In this chapter, there's quite a large amount of theory, but the theory will give us the knowledge that we need to start using object-oriented programming (OOP) with some expertise. Furthermore, we will not waste any time in putting that theory to good use as we will use it to code the next project, a Pong game. We will get to look behind the scenes at how we can create new types that we can use as objects by coding a class. First, we will look at a simplified Pong scenario so that we can learn about some class basics, and then we will start again and code a Pong game for real using the principles we have learned.
In this chapter, we will cover the following topics:
- Learn about OOP and classes using a hypothetical
Bat
class - Start working on the Pong game and code a real class to represent the player's bat