© Stewart Watkiss 2020
S. WatkissBeginning Game Programming with Pygame Zerohttps://doi.org/10.1007/978-1-4842-5650-3_9

9. Object-Oriented Programming

Stewart Watkiss1 
(1)
Redditch, UK
 

The programs so far have been primarily using a procedural style of programming. The procedural coding style is a good way to learn programming, but there are benefits to using object-oriented programming, which will be covered next. A useful thing about Python is that it supports many different coding styles, even allowing multiple styles in the same code. You have already been using some object-oriented code when making use of Python modules, including Pygame Zero.

After explaining the main concepts of object-oriented programming, this chapter will start a new game. ...

Get Beginning Game Programming with Pygame Zero: Coding Interactive Games on Raspberry Pi Using Python 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.