Abstract
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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Rights and permissions
Copyright information
© 2010 by Jeanine Meyer
About this chapter
Cite this chapter
Meyer, J. (2010). Rock, Paper, Scissors. In: The Essential Guide to HTML5. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-3384-8_8
Download citation
DOI: https://doi.org/10.1007/978-1-4302-3384-8_8
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4302-3383-1
Online ISBN: 978-1-4302-3384-8
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books