Swipe to navigate through the chapters of this book
By now, you’ve implemented quite a large part of the Painter game. You’ve seen how to define game object classes by using the prototype mechanism. By using these classes, you gain more control over how game objects are structured and how you can create game objects of a certain type. You separate these class definitions over different files. That way, when you need a cannon or a ball with the same behavior in a future game you’re working on, you can simply copy these files and create instances of these game objects in your game.
Please log in to get access to this content
To get access to this content you need the following product:
- Colors and Collisions
- Sequence number
- Chapter number
- Chapter 9