Appendix. The Crypt: a running example

 

In part 1 of this book, while learning core JavaScript concepts, you write code to represent the players and the places in the game and to let players move from place to place and pick up items. The following figure shows the components you create; a similar figure in each chapter highlights the ideas being discussed in the context of the entire game.

Part 2 of the book adds challenges for players: blocking exits until players solve puzzles. The focus is on organizing your code, hiding how it works, checking user input, and building modules that you can reuse and swap to make the project more flexible.

In part 3, you update the display to use HTML templates, modify the game to load data while it’s running, fill the templates with player and place information, and add text boxes and buttons so that players can enter commands via a web page.