Book Image

HTML5 Game Development Hotshot

By : Seng Hin Mak, Makzan Makzan (Mak Seng Hin)
Book Image

HTML5 Game Development Hotshot

By: Seng Hin Mak, Makzan Makzan (Mak Seng Hin)

Overview of this book

Table of Contents (15 chapters)
HTML5 Game Development HOTSHOT
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Placing the defense buildings


In this task, we work on the board and allow the player to add buildings.

Prepare for lift off

We are going to need some new files, the helpers and buildings. Specifically, they are helpers.js, building.js, space-junk.js, satellite.js, satellite2.js, castle.js, and castle2.js. Create these files and include them into the HTML file. Also, note that the buildings are placed inside the scripts/board-objects/buildings/ folder:

<script src="scripts/helpers.js"></script>
<script src="scripts/board-objects/buildings/building.js"></script>
<script src="scripts/board-objects/buildings/space-junk.js"></script>
<script src="scripts/board-objects/buildings/satellite.js"></script>
<script src="scripts/board-objects/buildings/satellite2.js"></script>
<script src="scripts/board-objects/buildings/castle.js"></script>
<script src="scripts/board-objects/buildings/castle2.js"></script>

The first helper...