O'Reilly logo

Pro HTML5 Games by Aditya Ravi Shankar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required