2010 | OriginalPaper | Chapter
Hangman
Activate our intelligent search to find suitable subject content or patents.
Select sections of text to find matching patents with Artificial Intelligence. powered by
Select sections of text to find additional relevant content using AI-assisted search. powered by
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.