We created the layers' foundation in the last task. The city layer was empty. In this task, we focus on the city layer where we put tiles and buildings.
First, we will draw some graphics for the isometric city. Any graphic editor should work. To draw a floor tile, we use the steps shown in the following figure:
The resulting graphic is our base floor and we can start drawing buildings on top of it. Besides the tile graphic, we also put the city-bg.png
file in the images
folder, as shown in the following screenshot:
We will need two more JS files for this task. Create the following two JS files inside the scripts
folder:
scripts/view-sprites.js scripts/helpers.js
For newly created files, we need to include them inside our index.html
file before loading the game.js
file:
<script...