Gary Rosenzweig0789737027, 9780789737021
Table of contents :
ActionScript 3.0 game programming university……Page 1
Contents……Page 5
Introduction……Page 16
Flash and Game Development……Page 17
Prerequisite Knowledge……Page 18
Using the Example Games in Your Projects……Page 19
The FlashGameU.com Website……Page 20
1. Using Flash and ActionScript 3.0……Page 22
What Is ActionScript 3.0?……Page 23
A Simple Use of trace……Page 24
Creating Screen Output……Page 27
Our First ActionScript 3.0 Class……Page 28
Working with Flash CS3……Page 30
The Stage……Page 31
The Library……Page 32
The Timeline……Page 33
Writing and Editing ActionScript……Page 34
Smallest Step Approach……Page 37
Good Programming Practices……Page 38
Creating and Using Variables……Page 41
Condition Statements……Page 42
Loops……Page 43
Types of Bugs……Page 44
Methods of Testing……Page 45
Using the Debugger……Page 46
Formats……Page 48
Flash……Page 49
HTML……Page 50
Publishing and Document Settings……Page 51
Class, Function, and Variable Names……Page 52
Runtime Issues……Page 53
Testing Issues……Page 54
2. ActionScript Game Elements……Page 56
Using Movie Clips……Page 57
Making Buttons……Page 59
Drawing Shapes……Page 62
Drawing Text……Page 64
Creating Linked Text……Page 66
Creating Sprite Groups……Page 68
Mouse Input……Page 70
Keyboard Input……Page 71
Text Input……Page 73
Sprite Movement……Page 74
Using Timers……Page 76
Time-Based Animation……Page 77
Physics-Based Animation……Page 78
Moving Sprites……Page 80
Dragging Sprites……Page 82
Collision Detection……Page 83
External Variables……Page 84
Saving Local Data……Page 86
Custom Cursors……Page 87
Playing Sounds……Page 89
Loading Screen……Page 90
Random Numbers……Page 91
Shuffling an Array……Page 92
Displaying a Clock……Page 93
System Data……Page 94
Game Theft and Security……Page 95
3. Basic Game Framework: A Matching Game……Page 98
Placing Interactive Elements……Page 99
Methods for Creating Game Pieces……Page 100
Setting Up the Flash Movie……Page 101
Creating the Basic ActionScript Class……Page 102
Using Constants for Better Coding……Page 105
Shuffling and Assigning Cards……Page 107
Adding Keyboard Listeners……Page 110
Setting Up Game Logic……Page 111
Checking for Game Over……Page 115
Encapsulating the Game……Page 117
Creating the Game Movie Clip……Page 118
Adding an Introduction Screen……Page 119
Adding a Play Again Button……Page 120
Adding Scoring……Page 121
Adding a Clock……Page 124
Displaying Time……Page 125
Displaying Score and Time after the Game Is Over……Page 127
Animated Card Flips……Page 128
Limited Card-Viewing Time……Page 131
Sound Effects……Page 132
Modifying the Game……Page 134
4. Brain Games: Memory and Deduction……Page 136
Arrays……Page 137
Data Objects……Page 139
Memory Game……Page 140
Preparing the Movie……Page 141
Programming Strategy……Page 142
Class Definition……Page 143
Setting the Text, Lights, and Sounds……Page 145
Playing the Sequence……Page 148
Switching Lights On and Off……Page 149
Accepting and Checking Player Input……Page 150
Modifying the Game……Page 152
Deduction Game……Page 153
Setting Up the Movie……Page 154
Defining the Class……Page 156
Starting a New Game……Page 158
Checking Player Guesses……Page 160
Evaluating Player Moves……Page 161
Ending the Game……Page 164
Clearing Game Elements……Page 166
Modifying the Game……Page 167
5. Game Animation: Shooting and Bouncing Games……Page 170
Time-Based Animation……Page 171
Coding Time-Based Animation……Page 173
Air Raid……Page 176
Flying Airplanes……Page 177
Moving Gun……Page 181
Skyward Bullets……Page 184
The Game Class……Page 186
Modifying the Game……Page 193
Setting Up the Movie……Page 194
Class Definition……Page 196
Starting the Game……Page 198
Starting a New Ball……Page 200
Game Animation and Collision Detection……Page 201
Game Over……Page 207
Modifying the Game……Page 208
6. Picture Puzzles: Sliding and Jigsaw……Page 210
Loading a Bitmap……Page 211
Breaking a Bitmap into Pieces……Page 213
Sliding Puzzle Game……Page 215
Setting Up the Class……Page 216
Cutting the Bitmap into Pieces……Page 219
Shuffling the Pieces……Page 221
Reacting to Player Clicks……Page 224
Animating the Slide……Page 226
Modifying the Game……Page 228
Setting Up the Class……Page 229
Loading and Cutting the Image……Page 231
Dragging Puzzle Pieces……Page 234
Game Over……Page 239
Modifying the Game……Page 240
7. Direction and Movement: Space Rocks……Page 242
The Sin and Cos Functions……Page 243
Using Cos and Sin to Drive a Car……Page 245
Calculating an Angle from a Location……Page 248
Air Raid II……Page 251
Altering the Gun……Page 252
Changing the Bullets……Page 254
Changes to AirRaid2.as……Page 256
Game Elements and Design……Page 257
Setting Up the Graphics……Page 259
Setting Up the Class……Page 261
Starting the Game……Page 263
Score and Status Display Objects……Page 264
Ship Movement and Player Input……Page 267
Shields Up!……Page 271
Rocks……Page 272
Missiles……Page 276
Game Control……Page 277
Modifying the Game……Page 280
8. Casual Games: Match Three……Page 282
Reusable Class: Point Bursts……Page 283
Developing the Point Burst Class……Page 284
Using Point Bursts in a Movie……Page 288
Playing Match Three……Page 291
Game Functionality Overview……Page 292
The Movie and MatchThree Class……Page 293
Setting Up the Grid……Page 294
Player Interaction……Page 297
Animating Piece Movement……Page 300
Finding Matches……Page 302
Finding Possible Moves……Page 307
Score Keeping and Game Over……Page 310
Modifying the Game……Page 311
9. Word Games: Hangman and Word Search……Page 312
ActionScript 3.0 String Handling……Page 313
Applying Text Formatting to Text Fields……Page 318
Setting Up the Hangman……Page 324
The Hangman Class……Page 325
Development Strategy……Page 328
Defining the Class……Page 330
Creating the Word Search Grid……Page 331
User Interaction……Page 335
Dealing with Found Words……Page 338
Modifying the Game……Page 341
10. Questions and Answers: Trivia and Quiz Games……Page 342
Understanding XML Data……Page 343
Importing External XML Files……Page 345
Trivia Quiz……Page 347
Setting Up the Movie……Page 348
Setting Up the Class……Page 349
Message Text and Game Button……Page 352
Moving the Game Forward……Page 354
Displaying the Questions and Answers……Page 355
Judging the Answers……Page 357
Ending the Game……Page 358
Adding a Time Limit……Page 359
Adding Hints……Page 362
Adding a Factoid……Page 364
Adding Complex Scoring……Page 365
Randomizing the Questions……Page 367
Better Answer Arrangement……Page 368
Creating Loader Objects……Page 370
Determining the Right Answer……Page 371
Expanding the Click Area……Page 372
Images for Questions……Page 373
Modifying the Game……Page 374
11. Action Games: Platform Games……Page 376
Level Design……Page 377
Designing the Class……Page 383
Planning Which Functions Are Needed……Page 384
Class Definition……Page 385
Starting the Game and Level……Page 387
Keyboard Input……Page 391
The Main Game Loop……Page 392
Character Movement……Page 393
Scrolling the Game Level……Page 399
Enemy and Player Death……Page 400
Collecting Points and Objects……Page 402
Ending the Levels and the Game……Page 404
The Game Dialog Box……Page 405
Modifying the Game……Page 406
12. Game Worlds: Driving and Exploration Game……Page 408
Creating a Top-Down World……Page 409
Game Design……Page 412
The Class Definition……Page 415
The Constructor Function……Page 417
Placing the Trash……Page 419
Keyboard Input……Page 421
The Game Loop……Page 422
Moving the Car……Page 423
Checking for Trash and Trashcan Collisions……Page 426
The Score Indicators……Page 428
Game End……Page 429
Racing Game Elements……Page 430
Making the Track……Page 431
Constants and Variables……Page 433
Starting the Game……Page 434
The Main Game Loop……Page 435
Car Movement……Page 437
Checking Progress……Page 439
The Countdown and the Clock……Page 440
Modifying the Game……Page 442
A……Page 444
C……Page 445
E……Page 447
G……Page 448
L……Page 449
M……Page 450
O–P……Page 451
S……Page 452
T……Page 454
W–Z……Page 455
Reviews
There are no reviews yet.