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 8

image

Adding More Game Elements

In the previous chapter, we developed a framework for unit movement that combined pathfinding and steering. We used this framework to implement move and deploy orders for the vehicles. Finally, we made our unit movement look smoother by interpolating the movement steps during intermediate drawing cycles.

We now have a game where the player can select units and command them to move around the map.

In this chapter, we will build upon this code by adding some more game elements. We will start by implementing an economy where the player can earn money by harvesting and then spend the money on creating buildings ...

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