Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Box2D for Flash Games

You're reading from  Box2D for Flash Games

Product type Book
Published in Nov 2012
Publisher Packt
ISBN-13 9781849519625
Pages 166 pages
Edition 1st Edition
Languages

Table of Contents (15) Chapters

Box2D for Flash Games
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Hello Box2D World 2. Adding Bodies to the World 3. Interacting with Bodies 4. Applying Forces to Bodies 5. Handling Collisions 6. Joints and Motors 7. Skinning the Game 8. Bullets and Sensors Index

Chapter 1. Hello Box2D World

If you want to create 2D physics-driven games and applications, Box2D is the best choice available. Box2D is a 2D rigid body simulation library used in some of the most successful games, such as Angry Birds and Tiny Wings on iPhone or Totem Destroyer and Red Remover on Flash. Google them, and you'll see a lot of enthusiastic reviews.

Before we dive into the Box2D World, let me explain what is a rigid body . It's a piece of matter that is so strong that it can't be bent in any way. There is no way to modify its shape, no matter how hard you hit it or throw it. In the real world, you can think about something as hard as a diamond, or even more. Matter coming from outer space that can't be deformed.

Box2D only manages rigid bodies, which will be called just "bodies" from now on, but don't worry, you will also be able to simulate stuff which normally is not rigid, such as bouncing balls.

Let's see what you are about to learn in this chapter:

  • Downloading and installing Box2D for Flash

  • Including required classes in your Flash projects

  • Creating your first Box2D World

  • Understanding gravity and sleeping bodies

  • Running your first empty simulation, handling time steps, and constraints

By the end of the chapter, you will be able to create an empty, yet running world where you can build your awesome physics games.

You have been reading a chapter from
Box2D for Flash Games
Published in: Nov 2012 Publisher: Packt ISBN-13: 9781849519625
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}