The Essential Guide to Physics for Flash Games, Animation, and Simulations

Book description

Physics for Flash Games, Animation, and Simulations teaches ActionScript programmers how to incorporate real physics into their Flash animations, games, user interfaces, and simulations.

  • Introduces Flash physics in an accurate, but approachable way, covering what is required to produce physically realistic simulations (as opposed to animations that look roughly right)

  • Packed full of practical examples of how physics can be applied to your own games and applications

  • Addresses the diverse needs of game developers, animators, artists, and e-learning developers

The book assumes a basic knowledge of ActionScript and Flash. However, no previous knowledge of physics is required—only some very basic math skills. The authors present everything from basic principles to advanced concepts, so you'll be able to follow the logic and easily adapt the principles to your own applications. The book builds on your physics knowledge, enabling you to create not only visual effects, but also more complex models and simulations.

What you'll learn

  • Basic math and physics you'll need to incorporate realism into your games, animations and simulations

  • How to incorporate a wide range of forces, including environmental forces such as gravity and friction, and forces due to fluids, such as drag and upthrust

  • How to build a number of realistic simulations, like submarines and flight simulators

  • How to model particle systems and use them for generative art and to create effects, such as smoke

  • Numerical subtleties, including accuracy and stability of integration schemes and handling boundary conditions properly; and how and when to use approximations and analytical solutions

Who this book is for

Flash developers interested in incorporating real physics into their games, animations, simulations or generative art projects.

Table of contents

  1. Title
  2. Dedication
  3. Contents at a Glance
  4. Contents
  5. About the Authors
  6. About the Technical Reviewer
  7. About the Cover Image Artist
  8. Acknowledgments
  9. Preface
    1. What this book will (and won't) teach you
    2. Overview of this book
    3. Source code and examples
  10. Part I: The Basics
    1. Chapter 1: Introduction to Physics Programming
      1. Why model real physics?
      2. What is physics?
      3. Programming physics
      4. A simple example
      5. Summary
    2. Chapter 2: Selected ActionScript 3.0 Topics
      1. ActionScript 3.0 classes
      2. ActionScript 3.0 language basics
      3. Events in ActionScript 3.0
      4. The Flash coordinate system
      5. The Flash drawing API
      6. Producing animation using code
      7. Collision detection
      8. Summary
    3. Chapter 3: Some Math Background
      1. Coordinates and simple graphs
      2. Basic trigonometry
      3. Vectors and basic vector algebra
      4. Simple calculus ideas
      5. Summary
    4. Chapter 4: Basic Physics Concepts
      1. General physics concepts and notation
      2. Things: particles and other objects in physics
      3. Describing motion: kinematics
      4. Predicting motion: forces and dynamics
      5. Energy concepts
      6. Summary
  11. Part II: Particles, Forces, and Motion
    1. Chapter 5: The Laws Governing Motion
      1. Newton’s laws of motion
      2. Applying Newton’s laws
      3. Newton’s second law as a differential equation
      4. The principle of energy conservation
      5. The principle of momentum conservation
      6. Laws governing rotational motion
      7. Summary
    2. Chapter 6: Gravity, Orbits, and Rockets
      1. Gravity
      2. Orbits
      3. Local gravity
      4. Rockets
      5. Summary
    3. Chapter 7: Contact and Fluid Forces
      1. Contact forces
      2. Pressure
      3. Upthrust (buoyancy)
      4. Drag
      5. Lift
      6. Wind and turbulence
      7. Summary
    4. Chapter 8: Restoring Forces: Springs and Oscillations
      1. Springs and oscillations: Basic concepts
      2. Free oscillations
      3. Damped oscillations
      4. Forced oscillations
      5. Coupled oscillators: Multiple springs and objects
      6. Summary
    5. Chapter 9: Centripetal Forces: Rotational Motion
      1. Kinematics of uniform circular motion
      2. Centripetal acceleration and centripetal force
      3. Non-uniform circular motion
      4. Summary
    6. Chapter 10: Long-Range Forces
      1. Particle interactions and force fields
      2. Newtonian gravitation
      3. Electrostatic force
      4. Electromagnetic force
      5. Other force laws
      6. Summary
  12. Part III: Multi-particle and Extended Systems
    1. Chapter 11: Collisions
      1. Collisions and their modeling
      2. Bouncing off horizontal or vertical walls
      3. Bouncing off inclined walls
      4. Collisions between particles in 1D
      5. Collisions between particles in 2D
      6. Summary
    2. Chapter 12: Particle Systems
      1. Introduction to particle system modeling
      2. Creating animated effects using particles
      3. Particle animations with long-range forces
      4. Interacting particle systems
      5. Summary
    3. Chapter 13: Extended Objects
      1. Rigid bodies
      2. Deformable bodies
      3. Summary
  13. Part IV: Building More Complex Simulations
    1. Chapter 14: Numerical Integration Schemes
      1. General principles
      2. Euler integration
      3. Runge-Kutta integration
      4. Verlet integration
      5. Summary
    2. Chapter 15: Other Technical Issues
      1. Doing physics in 3D
      2. Building scale models
      3. Building accurate simulations
      4. Summary
    3. Chapter 16: Simulation Projects
      1. Build a submarine
      2. Build a flight simulator
      3. Create an accurate solar system model
      4. Summary
  14. Index

Product information

  • Title: The Essential Guide to Physics for Flash Games, Animation, and Simulations
  • Author(s):
  • Release date: October 2011
  • Publisher(s): Apress
  • ISBN: 9781430236740