You are previewing Real-World Flash Game Development, 2nd Edition.
O'Reilly logo
Real-World Flash Game Development, 2nd Edition

Book Description

Your deadline just got moved up. Your artist has never worked with Flash before. Your inner programmer is telling you that no OOP is a big Oops! Any Flash developer can share similar tales of woe. This book breaks down the process of Flash game development into simple, approachable steps. Never heard of a game loop before? No idea what a design pattern is? No problem! Chris Griffith gives you real-world expertise, and real-world code that you can use in your own games.  Griffith has been building games in Flash long enough to know what works and what doesn't. He shows you what you need to know to get the job done.

Griffith covers Flash for the everyday developer. The average Flash developer doesn't have luxurious timelines, employers who understand the value of reusability, or the help of an information architect to design a usable experience. This book helps bridge the gap for these coders who may be used to C++, Java, or C# and want to move over to Flash. Griffith covers real-world scenarios pulled from his own experiences developing games for over 10 years in the industry.

The 2nd edition will include: completely new game examples on more advanced topics like 3D; more robust physics and collision detection; and mobile device coverage with Android platform development for us on phones and tablets. Also coverage of the new features available in Flash CS5, Flash Player 10.1, and AIR 2.0 that can be used for game development.

The associated web site for the book: www.flashgamebook.com gets close to 1,000 visits a month. On the site, readers can find all the source code for the examples, news on industry happenings, updates and special offers, and a discussion forum to ask questions and share ideas.

Table of Contents

  1. Cover
  2. Halftitle
  3. Title
  4. Copyright
  5. Contents
  6. Introduction
  7. Chapter 1 Computer Science Isn't for Everyone
    1. A Little Groundwork
    2. Common Game Types
    3. General Development Terms
    4. Game-Specific Development Terms
    5. Flash Development Terms
    6. You Can Wake Up Now
  8. Chapter 2 The Best Tool for the Job
    1. Flash Back
    2. The Case for Flash
    3. Nobody's Perfect
    4. Stop Fighting It
    5. Things Flash Was Built to Do
    6. The Best Tool for the Job
  9. Chapter 3 A Plan is Worth a Thousand Aspirin
    1. Step 1
    2. Step 2
    3. Step 3
    4. Step 4
    5. Step 5
    6. Step 6 (Optional)
  10. Chapter 4 //Comments FTW!
    1. Fair Warning
    2. Part 1: Classes
    3. Part2: Events
    4. Part3: Errors
    5. Part 4: Data Structures and Lists
    6. Part 5: Keep Your Comments to Everyone Else!
    7. Part 6: Why Does Flash Do That?
    8. Conclusion
  11. Chapter 5 The Least You Can Do versus an Architect's Approach
    1. Basic Encapsulation: Classes and Containers
    2. Store Relevant Values as Variables and Constants
    3. Don't Rely on Your Stage
    4. Don't Use Frameworks or Patterns You Don't Understand or That Don't Apply
    5. Know When It's Okay to Phone It In and When It Definitely Isn't
    6. Transitioning to Architecture
    7. OOP Concepts
    8. Practical OOP in Game Development
    9. The Singleton: A Good Document Pattern
    10. Summary
  12. Chapter 6 Managing Your Assets and Working with Graphics
    1. A Better File Format
    2. A Few Words about Organization
    3. Working with Graphics
    4. Raster Formats to Use
    5. Key Points to Remember
  13. Chapter 7 Make It Move—ActionScript Animation
    1. A Little Terminology
    2. To Tween or Not to Tween? Is That a Question?
    3. A Simple Scripted Shooter
    4. Memory: Tweening Animation
    5. Summary
  14. Chapter 8 Turn It up to 11: Working with Audio
    1. Formatsto Use
    2. Export Settings to Use
    3. Using External Files
    4. Tools for Working with Sounds
    5. Scripting Sounds
  15. Chapter 9 Put the Video Back in “Video Game”
    1. Video Codecs
    2. External Video Uses: Cutscenes and Menus
    3. CutsceneManager
    4. Video on the Timeline
    5. Setting Up an Internal Video
    6. Summary
  16. Chapter 10 XML and Dynamic Content
    1. Bringing Data In: Understanding the URLLoader Class
    2. XML
    3. E4X
    4. Crossword Puzzle
    5. Content Is a Two-Way Street: A Crossword Builder
    6. Sending Data Back Out
    7. One More Example: XML versus Flash Vars
    8. Summary
  17. Chapter 11 Four-Letter Word: M-A-T-H
    1. The Math Class
    2. Part One: Geometry and Trigonometry
    3. A Quick Explanation of Radians and Pi
    4. 3D in Flash
    5. Perspective Projection
    6. The SimpleTunnelShooter Example
    7. Part Two: Physics
    8. Example: A Top–Down Driving Engine
    9. Example: Top–Down Driving Game with Drift
    10. Review
  18. Chapter 12 Don't Hit Me: Collision Detection Techniques
    1. What You Can Do versus What You Need
    2. HitTestObject—The Most Basic Detection
    3. HitTestPoint—One Step up
    4. Radius/Distance Testing—Great for Circles
    5. Rect Testing
    6. Pixel-Perfect Collision Detection and Physics
    7. When All Else Fails, Mix ’N Match
  19. Chapter 13 MixUp—A Simple Engine
    1. The Main Document
    2. The MixUp Class
    3. The Title Class
    4. The RulesPanel Class
    5. The Game Class
    6. The Interfaces
    7. The GameBoard Class
    8. The SourceImageEmbedded Class
    9. The GameHistory and Results Classes
    10. The SourceImageCamera Class
    11. Review
  20. Chapter 14 Bringing It All Together: A Platformer
    1. The Platformer Genre
    2. Data Flow
    3. The Game Flow and Features
    4. The Level File Format and Asset Structure
    5. The Engine Classes
    6. The IWall Interface
    7. The CollisionGrid Class
    8. The Game Class
    9. The Asset Classes
    10. Taking It Further
  21. Chapter 15 Marble Runner: Our First Mobile Game
    1. Part 1: Best Practices for iOS Games
    2. The GPU Is Here to Help
    3. Code Matters, Too
    4. A Question of Balance: Inheritance versus Interfaces
    5. A Real-World Example
    6. Part 2: Marble Runner
    7. The Accelerometer Class
    8. How Accelerometer Values Are Computed
    9. The Game: Marble Runner
    10. Design Considerations
    11. Where to Take It
  22. Chapter 16 Air Hockey: A Multitouch, Multiplayer Tablet Game
    1. A Trio of Topics
    2. Multitouch Input for Devices
    3. The Finite-State Machine
    4. Physics Simulation with Box2D
    5. The Game: Two-Player Air Hockey
    6. Conclusion
  23. Afterword: Flash’s Future in Games
  24. Index