© Sloan Kelly  2019
Sloan KellyPython, PyGame, and Raspberry Pi Game Developmenthttps://doi.org/10.1007/978-1-4842-4533-0_14

14. Introducing Object-Oriented Programming

Sloan Kelly1 
(1)
Niagara Falls, ON, Canada
 
Until now we have been using Python as a structured language. Each line is executed one after the other. If we want to reuse code, we create functions. There is another way to program called object-oriented programming. In object-oriented programming we create little objects that not only hold our data but group the operations – the things we want to do with that data – with the data itself. The main features of object-oriented programming, or OOP for short, are
  • Encapsulation

  • Abstraction

  • Inheritance

  • Polymorphism

The next two chapters will cover ...

Get Python, PyGame, and Raspberry Pi Game Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.