CHAPTER 6

image

Adding Entities to Our World

In the previous chapter, we put together the basic framework for our RTS game. We loaded a level and panned around using the mouse.

In this chapter, we will build upon that by adding entities to our game world. We will build a general framework that will allow us to easily add entities such as buildings and units to a level. Finally, we will add the ability for the player to select these entities using the mouse.

Let’s get started. We will use the code from Chapter 5 as our starting point.

Defining Entities

These are the game entities we will be adding to our game:

  • Buildings: Our game will have four types ...

Get Pro HTML5 Games 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.