Rock, Paper, Scissors

  • Jeannie Meyer


In this chapter, you learned how to implement a familiar game using features of HTML5, JavaScript, and CSS, along with general programming techniques. These included
  • styles, in particular the font-family property

  • form and input fields for displaying the score

  • event handling using addEventListener for the mouse click event

  • animation using setInterval and clearInterval

  • audio elements for sound and source elements for working with different browsers

  • getElementByTagname and play for specific control of audio clips

  • programmer-defined objects for drawing programmer-created buttons on the screen, with logic for determining if the mouse cursor was clicked on a specific button

  • arrays of arrays for game rules

The next chapter describes another familiar, childhood game: Hangman. It combines techniques of drawing on canvas and creating HTML elements using code that you have learned in previous chapters along with some new CSS and JavaScript features.


Global Variable Audio File Input Field Event Handling Computer Move 
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