Game Object Types

  • Arjan Egges


In the previous chapters, you’ve seen how to create a game world that contains a few different game objects, such as a cannon and a ball. You’ve seen how to let game objects interact with each other. For example, the ball object updates its color according to the color of the cannon. In this chapter, you add falling paint cans to the game world. However, before you can do that, you have to reexamine how to create and manage objects in JavaScript. I introduce the class concept as a means to create multiple game objects of a certain type. Then, you apply the class concept to other parts of the Painter game application. Furthermore, you learn how to incorporate randomness in your games.



Copyright information

© Arjan Egges 2014

Authors and Affiliations

  • Arjan Egges
    • 1
  1. 1.UtrechtThe Netherlands

Personalised recommendations