March 2021
Beginner to intermediate
686 pages
13h 6m
English
Since the second project, we have been using objects. You might have noticed that many of the objects have things in common, things such as variables for speed and direction, a RectF for handling collisions, and more besides.
As our objects have more in common, we should start taking more advantage of OOP, inheritance, polymorphism, and another concept we will now introduce, design patterns.
Inheritance, polymorphism, and design patterns will enable us to fashion a suitable hierarchy to try and avoid writing duplicate code and avoid sprawling classes with hundreds of lines. This type of disorganized code is hard to read, debug, or extend. The bigger the game project and the more object ...