INDEX
files
errors and, 19
saving, 12
fill method
paths and, 299
polygons and, 152
fillRect function, 75, 150
fillStyle property, 72, 75, 150
fillText function, 149
findball function, for slingshot sample, 108, 128
finish function
for mazes sample, 233
for slingshot sample, 109, 128
fire function, for cannonball sample, 111, 118
firstpick variable, 148, 153
Fisher-Yates algorithm, 328
flags, 153
flipback func tion , for memory game sample,
147, 154, 167
flyin function, for rock-paper-scissors game
sample, 270, 274, 275
font-family property, 269, 298, 330
font function, 149
font-style property, 8, 330
fonts
Hangman game sample and, 298
memory game sample and, 149, 166
safe web fonts and, 190, 269
footer element, 7, 187, 317, 330
for header statement, 74
for loop, 323
arrays and, 74, 185
blackjack card game sample and, 323
Hangman game sample and, 301
preventing cheating and, 154
radio buttons and, 232
foreign languages, 284
form element, 27
quiz sample and, 190
rock-paper-scissors game sample score
and, 268
for text, 38
form validation. See input validation
formatting, CSS styles for. See CSS styles
frame-by-frame (cel) animation, 68
frames, 270
function keyword, 26
functions, 11
best practices for, 80
defining your own, 26
naming conventions for, 25
timing events and, 76–77
fx property, intersection and, 222, 230
fy property, intersection and, 222, 230
G
G20 countries/capitals (sample) quiz. See quiz
game design, quality assurance and, 272
game state
craps game sample and, 24
Hangman game sample and, 295, 300
games
examples of. See samples
history of moves and, 262
new round feature for, 210
getElementById function
for Hangman game sample, 296
quiz sample and, 187
getElementsByTagname function, for rock-
paper-scissors game sample, 274
getkey function, for blackjack card game
sample, 328, 330
getkeyAndMove function, for mazes sample,
220, 233, 246
getTime function
for mazes sample, 230
for memory game sample, 148
getwalls function, for mazes sample, 233, 246
gif files, animated, 68
global variables, 26, 55
grad variable, 75
gradients, 72, 85–91
graphical buttons, 260, 263–266, 295
graphical feedback, 24
graphical user interface (GUI), 24
gravity, calculation for simulating, 100
ground variable, 103
GUI (graphical user interface), 24
H
h1-h6 heading elements, 7
Hangman game (sample), 287–316
building, 302–315
checking guesses/revealing letters in, 301