Symbols defense shields 221–222 game engine base 214–215 declaration 79, 110 Game Over screen 211 $db variable 105 heads-up display 225–227 $(document).ready function 256, 263 html page for 204 keyboard controls 219–221 Numerics lasers 223 mouse controls 219–221 3D drawing overview 202–204 complex models for 301 player ship 218 overview 297–298 screen transitions 215–216 Start screen 210–211 A UFOs animating 229 abort() method 319, 332–333 creating big UFO 217–218 about:flags page 395 dynamic movement of 230–231 accessibility 9–10 flocks of 227 Accessible Rich Internet Applications. See ARIA making UFOs shoot 232 accuracy attribute 327 paths for 228 action, forms 52 altitude attribute 327 activeCues array 401 altitudeAccuracy attribute 327 addElement() method 321 tag 202, 206, 208 addEventListener() method 86, 100, 102–103, animation 126 Canvas Ricochet game 173 agile planning board example for SVG 208 building process for 114–115 UFOs in SVG Aliens game 229 business logic for 119–123 Apache web server 347–350 handling updates in browser 123 API method 19, 26, 140–141 handling updates on server 124–125 .appcache extension 158 overview 113–114 app.js file 59, 73, 365–368, 370–371 prerequisites for 114 application cache manifest file 132 template page 118–119 configuring MIME types for 157–158 Airplane Mode 161 creating 158–160 Aliens game detecting changes in 160–162 collision detection 224 arc() method 178 CSS file for 205–206 arcTo() method 179
429 430 INDEX
ARIA (Accessible Rich Internet Applications) 4, B 9–10 arrays 283 background
Canvas API login form 106–107 Canvas Ricochet game overview 102–105 animation for 173 sending chat messages to server 108 background image 174–175 storing messages in database 108–109 coloring bricks 177–178 chat.js file 109, 127 creating ball 178–179 chat.sql file 344 creating game bricks 175 checkEnclosure() method 230 creating paddle 179 checking event 318 enabling collision detection 184 checkIntersection() method 230 enabling edge detection 183 checkValidity() method 60, 66, 318 engine object for 171–173 Chrome developer tools 379 Game Over screen for 194–195 class attribute 135–137, 140 keyboard controls for 186, 188–189 clear() method 130, 323 making ball move 182 clearData() method 322 mouse control for 187 clearWatch() method 326 moving paddle 182 client-side validation 13 removing hit bricks 184–185 cmp() method 328 score counter for 190–191 codecs, discovering which used in video 386 storing high scores online 192 collapsible content 14–15 testing 180 collide() method 184, 217 touch support for 187 collision detection Welcome screen for 193–194 displaying shape data 290 contents of canvas element 169 Geometry Destroyer game 303 libraries for ImpactJS 195 for items in canvas 184 overview 21, 165–166, 313 SVG Aliens game 224 reference links for 426 color buffers 287–288 setting context 166–169 combobox example 9 vs. SVG Command+Shift+H keyboard shortcut 350 community support 232–233 community support documentation 232–233 for Canvas 232–233 JavaScript integration 233 for SVG 232–233 pros and cons of 233–234 Configuration page, MySQL installer 342 verifying browser support 169–170 Constraint Validation API 317