The Essential Guide to HTML5

(Greg DeLong) #1

INDEX


testing web pages and, 19
video display and, 191
viewing web pages via, 11
builddeck function, for blackjack card game
sample, 323, 331, 346
button element, 38
buttons
graphical, 260, 263–266, 295
for Hangman game sample, 296–298


C
cache, clearing, 80
camel case naming convention, 25
cannon variable, 103
cannonball (sample), 97
building, 111–128
cannon for, 118–128
customizing, 127
testing/uploading, 140
the canvas (canvas element), 2, 21, 29–38
erasing and, 37, 76
everything array and, 101, 103
object information and, 106
text, drawing on, 149–151
card back, for memory game sample, 142
card counting, 320
card face, for memory game sample, 141
Card function, for memory game sample, 147,
155, 167
cards
for blackjack card game sample, 323
for memory game sample, 141–147, 152
Cascading Style Sheets. See CSS styles
case statement, 29
casts, 270
cball variable, 103
cel (frame-by-frame) animation, 68
change function
for bouncing ball sample, 80
for cannonball sample, 111, 118
for slingshot sample, 129
cheating, preventing in games/applications, 153
checked attribute, 232
chicken and feathers, for slingshot sample, 100,
110, 128
choices array, rock-paper-scissors game
sample and, 267


choose function
for memory game sample, 148, 153, 154, 167
for rock-paper-scissors game sample, 265,
267, 270, 272, 275
Chrome, form input validation and, 79, 80
circles, drawing, 32–38, 70, 299
clearInterval function, for rock-paper-scissors
game sample, 270
clearRect function, 37, 76
click event, for memory game sample, 152
clickable buttons, 265, 295
closePath command, 35, 37
closing tag, 4, 19
code
comments in, 47, 81, 155
indenting, 4
pseudo-code and, 28
code fragments, 25
collision detection
for bounding ball sample, 78
for mazes, 222–224
color coding, 13
color variable, 75
colors, 7
invalid input and, 69
memory game sample and, 166
quiz sample and, 190, 201
rock-paper-scissors game sample and, 269
comments, 47
best practices for, 81, 221
writing, 155, 221
compch variable, 267, 268
compchn variable, 267
compiled languages, 10
compimg variable, 267
computed animation, 68, 270
computer as game player
blackjack card game sample and, 317
Hangman game sample and, 287
rock-paper-scissors game sample and, 259,
267–274
concentration game. See memory game
conditional statements, 24, 27–29
constructor function, 102, 263, 324
context, 30
cookies, 216, 224
coordinate systems, 24, 30, 105
countries/capital cities quiz. See quiz
Free download pdf