In this chapter, you learned how to implement a familiar game using features of HTML5, JavaScript, and CSS along with general programming techniques, which included the following:
  • using the scale method to change the coordinate system to draw an oval, as opposed to a circle, by saving and restoring before and after

  • creating HTML markup dynamically

  • setting up and removing event handling using addEventListener and removeEventListener for individual elements

  • using styles to remove elements from display

  • using arrays of function names to set up a progression of drawings

  • manipulating variables to maintain the state of the game, with calculations to determine if there is a win or a loss

  • creating an external script file to hold the word list for increased flexibility

  • using CSS, including font-family for the selection of fonts, color, and display

The next and final chapter of this book will describe the implementation of the card game, blackjack, also called 21. It will build on what you have learned already and describe some new techniques in programming, elements added to HTML5, and more CSS.


Word List Game State Manipulate Variable Event Handling Stick Figure 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© by Jeanine Meyer 2010

Authors and Affiliations

  • Jeannie Meyer

There are no affiliations available

Personalised recommendations