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

Placing buildings on the floor

We are in the process of creating a building. We let the player choose the type of building in the previous task. In this task, we allow the players to choose where to place the selected building on the floor. There is a half-transparent building image following the cursor when selecting a tile to place the building. If the place is unavailable, we put a red overlay on top of the ghost building.

Prepare for lift off

We need the three building image files to be placed on the floor. Include the following three image files in the images folder of our project. The red overlay is added programmatically.

Prepare for lift off

Planning the placing ...

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