O'Reilly logo

HTML5 Game Development HOTSHOT by Makzan

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

Advancing the construction progress over time

We have placed some building constructions on the floor in the previous task. In this task, we advance the construction progress over time.

Prepare for lift off

We have the following two images to represent two steps of the building construction. Let's add them to the project's images folder.

Prepare for lift off

We defined BuildingsData in the previous task. Now, we add one more parameter to each building's data. The new parameter is the duration in seconds that each construction step takes:

game.BuildingsData['CoinsGenerator'] = { ... // existing building data goes here. stepsSeconds: [10, 20] }; game.BuildingsData['PowerSupply'] ...

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