Index Ideas, plans, 136–7 IE see Internet Explorer ‘If ’ statements, 9–11, 93, 96, 101–17, 196–7 And operation, 106–17 bugs, 103 comprehensive example, 115–17 concepts, 9–11, 101–17 conditions, 9–11, 101–17 examples, 9–11, 105, 107–17 logical opera<strong>to</strong>rs, 9–10, 102–17, 123–4 loops, 99–100, 118–35 nested ‘if ’ statements, 102–3, 115–17 Or operation, 106–17 small games, 196–7 truth tables, 106 uses, 9–11, 101–2 variants, 9–11, 101–2 IIS see Internet Information Services IK see Inverse Kinematics Implementation ideas, quizzes, 224 Imports: animations, 28, 46, 50–9 background art, 65, 69–70 bitmaps, 28, 46–59, 64, 69–70, 75–6 In-between positions, simple cut-out animation, 37–41 Include These Characters field, 109–10 Increment opera<strong>to</strong>r, concepts, 88, 118–35, 142, 157, 247–59 Infinite loops, 121, 158–60 InitAction function, platform games, 266–9, 278–9 InitBoard function, board games, 247–8 Initialization: errors, 123–8, 162 loops, 118–19, 123–30 variables, 118–19, 123–30, 144, 162 Ink Bottle <strong>to</strong>ol, 27 Ink option, 22 Inputs: see also User... databases, 211–15, 219–24, 340–3 registration pages, 329–36, 338–43 INSERT INTO command, SQL Server, 214–15, 341–3 Instance names, FCS, 365–6 Instructions, small games, 200–3 Integers, concepts, 95–7, 103, 201 Integrated Development Environment (IDE), 348 Internet, 108, 168–81, 189–92, 228–9, 243, 312, 318–21 see also Hyper Text Mark-up Language background, 168–81, 189–92, 243, 312, 318–21 cookies, 329, 334–6, 339–41 form-based web pages, 329–32 high score tables, 329–46 multi-player games, 347 overview, 168–72 security issues, 232 420 Internet Explorer (IE), 171–3, 179–80, 318–21 Internet Information Services (IIS), 177–8, 206, 211, 360–3 Inverse Kinematics (IK), 52–4 IP addresses, 168, 347–9 Iteration see Loops JavaScript, 102, 176–8, 179–81, 214–19, 321, 334–46 C++ similarities, 348 concepts, 102, 176–8, 179–81, 214–19, 346 current pages, 179–81 databases, 214–19, 334–46 fscommand, 179–81, 325–6 Jpeg format, concepts, 69–70 JumpLeft label, platform games, 260–80 JumpRight label, platform games, 260–80 Key positions, simple cut-out animation, 37–8 Keyboards: see also Individual keys concepts, 8–11, 260–75, 282, 325–6 examples, 260–75 PocketPCs, 325–6 sports simulations, 282–7, 292–6 sprite characters, 44–5, 260–75 Keyframes, 30–3, 405–10 Key.isDown construct, concepts, 9–11, 260–4, 292–3 Keylines, background art, 62–4 KickBall function, sports simulations, 294 Kickoff function, sports simulations, 285–7, 300 Knife <strong>to</strong>ol, Lightwave modeller, 46–52 Labels, 43–5 Land function, platform games, 273–5 LandLeft label, platform games, 260–80 LandRight label, platform games, 260–80 Languages, programming, 96–7 Lasso <strong>to</strong>ol, usage methods, 3–4, 35, 56 Layers: adding/deleting methods, 3 concepts, 1–14 debugging, 161–2 frame actions, 85–6 Pong, 1–14, 192–8, 314–15 simple cut-out animation, 35–45, 54 Tetris, 198–9 Left Arrow key, 45, 260–3, 292–3, 326 concepts, 260–3, 292–3 platform games, 260–3 sport simulations, 292–3 Left shift opera<strong>to</strong>r, concepts, 88–9 LegalMove function, board games, 252–8 Legitimacy checks, registration pages, 331–2, 339–41 Legs: left/right conventions, 37 Lightwave modeller, 49–53 Less-than opera<strong>to</strong>rs, 102, 124–5, 310, 315 Library, 6–7, 35, 130, 310–12, 323
Lightwave modeller, 46–54, 69, 226, 232–4 Line <strong>to</strong>ol, 3–6, 18–21 Arrow <strong>to</strong>ol, 19 colours, 18–20 curves, 19–21 grids, 19 stroke adjustments, 18 usage methods, 3–6, 18–20 Linear Gradient selection, Paint Bucket <strong>to</strong>ol, 28 Linear interpolation, 396 Linux, 360 Listen function, 349–50 LoadMaze function, 230–2 LoadVariables, concepts, 175–6, 189, 200–1, 219–24, 228, 341–2, 346 LoadVars object, concepts, 178–9, 217–18, 228–32, 235 Location tests, 10, 111–17, 145–6, 197 Lock Fill selection, 27–8 Logical opera<strong>to</strong>rs: ‘if ’ statements, 9–10, 102–17, 123–4 list, 102, 315–17 Login pages: ASPs, 337–8 concepts, 332–5, 337–8 high score tables, 332–5, 337–8 Loop Playback, 29–30, 37–8, 41 Loops, 99–100, 118–35 see also ‘Dowhile’...; ‘For’...; ‘While’... bugs, 120, 121–8, 158–60, 258–9 components, 129–30 concepts, 99–100, 118–35, 158–60 examples, 118–35 exit conditions, 123–4 infinite loops, 121, 158–60 initialization, 118–19, 123–30 jumps, 120–1 multidimensional arrays, 141–4 nested loops, 141–4 physical simulations, 131–5 simplicity guidelines, 119–20 skips, 122–3 sockets, 359 sports simulations, 287–91 MAC platforms, 173, 177, 206, 360 Macromedia, mobile devices, 73–4, 309 Mag function, 147–8 Magnet Snap <strong>to</strong> Objects option, 19, 21, 30 Magnifying Glass <strong>to</strong>ol, 54–5 MakeBoard function, 247 Math, 86, 96, 104–5, 128, 147–8, 195, 288–91, 294–9, 306, 395–410 see also Physics MazeLoaded function, 231–2, 235–6 Mazes, 226–43 arrays, 229–32, 236–7 camera paths, 233–4 Index concepts, 226–43 enhancements, 242 examples, 227–42 game creation, 234–42 genera<strong>to</strong>r programs, 227–32 ‘getting warmer/colder’ bars, 242 graphics, 232–4 grids, 226–7 Lightwave modeller, 226, 232–4 s<strong>to</strong>rage issues, 226–7 user input, 239–42 Medieval room, background art, 64 Member Variables tab, 381 Meshes: CGI programs, 47–52 concepts, 47–52 MFC see Microsoft Foundation Classes MFi files, 309, 310–12 Microsoft, 205–6, 329, 332, 347–56, 377–81, 385 see also Windows Foundation Classes (MFC), 347–56, 377–81 Office, 205–6, 329, 332 MIDI files, 309, 310–12 MIME-encoded variable forms, 217–18, 221, 227, 342–4, 346 Minimum Area selection, 55 Mld extensions, 312 Mobile devices: <strong>ActionScript</strong>, 74–5, 79, 309–17 bitmaps, 75–6 CDKs, 74, 309 colours, 76–7 concepts, 73–80, 309–17, 385–8 content creation, 79–80, 309–26 examples, 313–26, 385–8 <strong>Flash</strong> Lite, 74, 307, 309–17 frame rates, 75, 79 migration tips, 78–9 PocketPCs, 73–80, 318–26, 385–8 symbols, 79, 322–3 templates, 73, 309–10 ten <strong>to</strong>p tips, 78–9 testing, 312–17 types, 73–4, 309–17, 318–26 user input, 78 Mobile Devices option, 74, 309–10 Mobile phones, 73–80, 309–17 deck-of-cards analogy, 324 <strong>Flash</strong> Lite, 74, 307, 309–17 sound, 309, 310–12 user input, 78 Mode variables, movie clips, 237–42 Models, CGI programs, 46–59 Modem speeds, 34, 203 Modularization: benefits, 143–4 code, 136–51 concepts, 136–51 421
- Page 3 and 4:
Flash MX 2004 Games
- Page 5 and 6:
Flash MX 2004 Games Art to ActionSc
- Page 7 and 8:
Contents at a glance Introduction x
- Page 9 and 10:
Contents in summary Introduction xi
- Page 11 and 12:
Contents in summary Chapter 15: Maz
- Page 13 and 14:
Introduction: Learn to write Action
- Page 15 and 16:
1 Your first game Rather alarmingly
- Page 17 and 18:
Chapter 1: Your first game view of
- Page 19 and 20:
Using the Line tool Chapter 1: Your
- Page 21 and 22:
Chapter 1: Your first game Adding t
- Page 23 and 24:
Chapter 1: Your first game is true
- Page 25 and 26:
Chapter 1: Your first game would tr
- Page 27 and 28:
_x = startX; _y = startY; moveX = 0
- Page 29:
Section 1 Animation The first secti
- Page 32 and 33:
Flash MX 2004 Games Using the drawi
- Page 34 and 35:
Flash MX 2004 Games Figure 2.7 Stag
- Page 36 and 37:
Flash MX 2004 Games The Pencil tool
- Page 38 and 39:
Flash MX 2004 Games When you use th
- Page 40 and 41:
Flash MX 2004 Games Figure 2.25 Sca
- Page 42 and 43:
Flash MX 2004 Games To use a gradie
- Page 44 and 45:
Flash MX 2004 Games tweening was se
- Page 46 and 47:
Flash MX 2004 Games Figure 2.37 Usi
- Page 48 and 49:
3 Simple cut-out animation Flash is
- Page 50 and 51:
Flash MX 2004 Games Figure 3.4 Sele
- Page 52 and 53:
Flash MX 2004 Games Figure 3.7 Usin
- Page 54 and 55:
Flash MX 2004 Games Figure 3.10 The
- Page 56 and 57:
Flash MX 2004 Games pressing F5. Th
- Page 58 and 59:
Flash MX 2004 Games WalkLeft TurnLe
- Page 60 and 61:
4 Using CGI programs to create anim
- Page 62 and 63:
Flash MX 2004 Games that sometimes
- Page 64 and 65:
Flash MX 2004 Games Figure 4.6 The
- Page 66 and 67:
Flash MX 2004 Games Figure 4.9 The
- Page 68 and 69:
Flash MX 2004 Games As you get expe
- Page 70 and 71:
Flash MX 2004 Games colour layer us
- Page 72 and 73:
Flash MX 2004 Games A higher settin
- Page 74 and 75:
5 Background art All your games wil
- Page 76 and 77:
Flash MX 2004 Games Figure 5.3 A si
- Page 78 and 79:
Flash MX 2004 Games better to expor
- Page 80 and 81:
Flash MX 2004 Games if it is only d
- Page 82 and 83:
Figure 5.10 Using symbols to add te
- Page 84 and 85:
Flash MX 2004 Games independent whe
- Page 86 and 87:
Flash MX 2004 Games Using photograp
- Page 88 and 89:
Flash MX 2004 Games Website and you
- Page 90 and 91:
Flash MX 2004 Games 3 Choose ‘png
- Page 92 and 93:
Flash MX 2004 Games User input on m
- Page 94 and 95:
Flash MX 2004 Games Figure 6.8 Opti
- Page 97 and 98:
7 So what is a variable? After the
- Page 99 and 100:
Chapter 7: So what is a variable? a
- Page 101 and 102:
Chapter 7: So what is a variable? T
- Page 103 and 104:
Chapter 7: So what is a variable? B
- Page 105 and 106:
Chapter 7: So what is a variable? 3
- Page 107 and 108:
Chapter 7: So what is a variable? P
- Page 109 and 110:
Chapter 7: So what is a variable? 5
- Page 111 and 112:
Chapter 7: So what is a variable? n
- Page 113 and 114:
Chapter 7: So what is a variable? B
- Page 115 and 116:
8 In tip-top condition Should I go
- Page 117 and 118:
Chapter 8: In tip-top condition All
- Page 119 and 120:
Chapter 8: In tip-top condition Wit
- Page 121 and 122:
} } return false; Chapter 8: In tip
- Page 123 and 124:
Figure 8.5 Properties window for th
- Page 125 and 126:
Chapter 8: In tip-top condition to
- Page 127 and 128:
Chapter 8: In tip-top condition Tab
- Page 129 and 130:
Figure 8.12 The anchor point for th
- Page 131 and 132:
53 return 4; 54 } 55 } 56 } Listing
- Page 133 and 134:
Chapter 9: Using loops and the repe
- Page 135 and 136:
Chapter 9: Using loops Now instead
- Page 137 and 138:
do{ a++; if (a==10) continue; //Do
- Page 139 and 140:
Chapter 9: Using loops Two examples
- Page 141 and 142:
Figure 9.2 The Loops01 project at r
- Page 143 and 144:
Chapter 9: Using loops Creating sim
- Page 145 and 146:
Chapter 9: Using loops Creating phy
- Page 147 and 148:
1 //Initialise firing 2 for (i=0; i
- Page 149 and 150:
Chapter 9: Using loops heart of alm
- Page 151 and 152:
Chapter 10: Keep it modular a game
- Page 153 and 154:
Chapter 10: Keep it modular for(j=0
- Page 155 and 156:
Chapter 10: Keep it modular From a
- Page 157 and 158:
Chapter 10: Keep it modular To call
- Page 159 and 160:
4 pt2.init(20, 30); 5 pt2.sum(pt1);
- Page 161 and 162:
Chapter 10: Keep it modular a locat
- Page 163 and 164:
Chapter 10: Keep it modular 1 v1 =
- Page 165 and 166:
Chapter 10: Keep it modular Summary
- Page 167 and 168:
Chapter 11: Debugging would give th
- Page 169 and 170:
4 trace("n = " + n); 5 6 function s
- Page 171 and 172:
5 onClipEvent(enterFrame){ 6 count+
- Page 173 and 174:
10 name = "Box" + i; 11 eval(name).
- Page 175 and 176:
Chapter 11: Debugging 5 switch(i){
- Page 177 and 178:
Chapter 11: Debugging Using the Fla
- Page 179 and 180:
the Watch window, then you can see
- Page 181 and 182:
Figure 11.12 Debugging remotely Cha
- Page 183 and 184:
is presumed, www.niklever.net/flash
- Page 185 and 186:
Chapter 12: Using external files Th
- Page 187 and 188:
Chapter 12: Using external files Wh
- Page 189 and 190:
with a query string version: Chapte
- Page 191 and 192:
Figure 12.3 Developing the Weather
- Page 193 and 194:
function loaded(success){ if (succe
- Page 195:
Chapter 12: Using external files
- Page 199 and 200:
13 Small games to keep them loading
- Page 201 and 202:
Chapter 13: Small games to keep the
- Page 203 and 204:
Chapter 13: Small games to keep the
- Page 205 and 206:
Chapter 13: Small games to keep the
- Page 207 and 208:
Figure 13.7 Developing the Pong gam
- Page 209 and 210:
Chapter 13: Small games to keep the
- Page 211 and 212:
Chapter 13: Small games to keep the
- Page 213 and 214:
Chapter 13: Small games to keep the
- Page 215 and 216:
Chapter 13: Small games to keep the
- Page 217 and 218:
Chapter 13: Small games to keep the
- Page 219 and 220:
14 Quizzes Quizzes are a very popul
- Page 221 and 222:
Chapter 14: Quizzes For now we will
- Page 223 and 224:
Figure 14.5 Creating a user Chapter
- Page 225 and 226:
Figure 14.8 Setting user permission
- Page 227 and 228:
Remember that a querystring takes t
- Page 229 and 230:
Chapter 14: Quizzes 36 "\’, diffi
- Page 231 and 232:
Chapter 14: Quizzes the query strin
- Page 233 and 234:
s.Close(); conn.Close(); Response.W
- Page 235 and 236:
Chapter 14: Quizzes 1 function setQ
- Page 237 and 238:
5 status = "Question deleted"; 6 }
- Page 239 and 240:
Chapter 14: Quizzes Summary Most of
- Page 241 and 242:
Chapter 15: Mazes The strategy used
- Page 243 and 244:
Chapter 15: Mazes Notice that the f
- Page 245 and 246:
Chapter 15: Mazes 128, and exclude
- Page 247 and 248:
Figure 15.3 Creating the tunnel mod
- Page 249 and 250:
Chapter 15: Mazes Open ‘Examples\
- Page 251 and 252:
Chapter 15: Mazes sequence to show
- Page 253 and 254:
64 Tunnel.gotoAndPlay("T_Right"); 6
- Page 255 and 256:
Chapter 15: Mazes 32 dir = EAST; 33
- Page 257 and 258:
Chapter 15: Mazes Summary In common
- Page 259 and 260:
Figure 16.1 The traditional game Re
- Page 261 and 262:
5 cBoard = new Array(64); 6 pBoard
- Page 263 and 264:
Chapter 16: Board games 6 }else{ 7
- Page 265 and 266:
Chapter 16: Board games Once the pl
- Page 267 and 268:
Chapter 16: Board games Here ‘row
- Page 269 and 270:
19 }else{ 20 flip[2] = false; 21 }
- Page 271 and 272:
8 if (flip[6]) flipArrayLine(i, pie
- Page 273 and 274:
Chapter 16: Board games this way, i
- Page 275 and 276:
A simple example Figure 17.1 Develo
- Page 277 and 278:
Chapter 17: Platformers game much e
- Page 279 and 280:
Chapter 17: Platformers If the cat
- Page 281 and 282:
Chapter 17: Platformers 11 break; 1
- Page 283 and 284:
Chapter 17: Platformers 96 gotoAndP
- Page 285 and 286:
a metre. Therefore u − 20t = 0 an
- Page 287 and 288:
56 }else if (moveY-4){ 57 moveY -=
- Page 289 and 290:
13 name = "_root.Bin" + i; 14 dx =
- Page 291 and 292:
16 mc.scale = 1.0; 17 } 18 19 House
- Page 293 and 294:
Chapter 17: Platformers 68 }else if
- Page 295 and 296:
Chapter 17: Platformers array, ‘d
- Page 297 and 298:
Figure 18.1 Developing the football
- Page 299 and 300:
5 ScoreB = 0; 6 playerTeam = RED; 7
- Page 301 and 302:
50 Pitch.Red2.targetx = -96; 51 Pit
- Page 303 and 304:
Chapter 18: Sports simulations Havi
- Page 305 and 306:
Chapter 18: Sports simulations 37 k
- Page 307 and 308:
Chapter 18: Sports simulations 37 i
- Page 309 and 310:
Chapter 18: Sports simulations Upda
- Page 311 and 312:
26 break; 27 } 28 } 29 name = "_roo
- Page 313 and 314:
Chapter 18: Sports simulations 27 v
- Page 315 and 316:
Chapter 18: Sports simulations 1 fu
- Page 317 and 318:
Chapter 18: Sports simulations For
- Page 319 and 320:
Chapter 18: Sports simulations 22 _
- Page 321:
Section 4 Flash for mobiles The mob
- Page 324 and 325:
Flash MX 2004 Games Table 19.1 Synt
- Page 326 and 327:
Flash MX 2004 Games ‘Device sound
- Page 328 and 329:
Flash MX 2004 Games The game uses k
- Page 330 and 331:
Flash MX 2004 Games 316 Table 19.2
- Page 332 and 333:
20 Using Flash on a PocketPC Pocket
- Page 334 and 335:
Flash MX 2004 Games 1 2 3 Conker
- Page 336 and 337:
Flash MX 2004 Games 5 }else { 6 //
- Page 338 and 339:
Flash MX 2004 Games Figure 20.5 ‘
- Page 340 and 341:
Flash MX 2004 Games Reading the mai
- Page 343 and 344:
21 High score tables High score tab
- Page 345 and 346:
Chapter 21: High score tables Notic
- Page 347 and 348:
Figure 21.3 Creating an Access data
- Page 349 and 350:
Chapter 21: High score tables 12 Se
- Page 351 and 352:
Chapter 21: High score tables 1 so
- Page 353 and 354:
Chapter 21: High score tables ‘ge
- Page 355 and 356:
Chapter 21: High score tables Assum
- Page 357 and 358:
37 " has been set to " + score); 38
- Page 359 and 360:
Chapter 21: High score tables 19 fu
- Page 361 and 362:
22 Multi-player games using sockets
- Page 363 and 364:
Chapter 22: Multi-player games usin
- Page 365 and 366:
Chapter 22: Multi-player games usin
- Page 367 and 368:
The possible tags in this example a
- Page 369 and 370:
Chapter 22: Multi-player games usin
- Page 371 and 372:
Chapter 22: Multi-player games usin
- Page 373 and 374:
Chapter 22: Multi-player games usin
- Page 375 and 376:
Figure 23.1 Select Add/Remove Progr
- Page 377 and 378:
Figure 23.5 Configuring IIS Figure
- Page 379 and 380:
Figure 23.8 Running several simulta
- Page 381 and 382:
Chapter 23: Using Flash Communicati
- Page 383 and 384: Chapter 23: Using Flash Communicati
- Page 385 and 386: Figure 23.11 Live Log tab of the ad
- Page 387 and 388: Chapter 23: Using Flash Communicati
- Page 389 and 390: 24 Embedding Flash In this chapter
- Page 391 and 392: Chapter 24: Embedding Flash You can
- Page 393 and 394: Figure 24.5 Choosing the source fil
- Page 395 and 396: Chapter 24: Embedding Flash A dialo
- Page 397 and 398: Chapter 24: Embedding Flash resourc
- Page 399 and 400: Chapter 24: Embedding Flash can be
- Page 401 and 402: Chapter 24: Embedding Flash 46 { 47
- Page 403 and 404: Appendix A: Integrating Flash with
- Page 405 and 406: Figure A.2 Importing the Flash inte
- Page 407 and 408: Appendix A where ‘clipName’ is
- Page 409 and 410: Appendix B: Tweening in code The ea
- Page 411 and 412: Figure B.1 The graph of y = x 2 App
- Page 413 and 414: Appendix B Joining together curves
- Page 415 and 416: Appendix B want the result to start
- Page 417 and 418: Figure B.7 Creating the tweening pr
- Page 419 and 420: Appendix B Creating keyframes So fa
- Page 421 and 422: and if the curve section is between
- Page 423 and 424: } switch (channel){ case 0: return
- Page 425 and 426: Bibliography Art The Illusion of Li
- Page 427 and 428: Index 3D Studio Max animations, 54
- Page 429 and 430: Buttons: concepts, 6, 113-15, 126-8
- Page 431 and 432: fashions, 60 simplicity benefits, 3
- Page 433: Floats: bugs, 96 concepts, 95-7 Flu
- Page 437 and 438: Paint Bucket tool, 4, 5, 27-9 optio
- Page 439 and 440: Set Score button, 340-2 Set-top box
- Page 441 and 442: outline, 17 sections, 17, 21-8 usag