Box2D for Flash Games

Create amazing and realistic physics-based Flash games using Box2D with this book and ebook.
Preview in Mapt

Box2D for Flash Games

Emanuele Feronato

1 customer reviews
Create amazing and realistic physics-based Flash games using Box2D with this book and ebook.
Mapt Subscription
FREE
$29.99/m after trial
eBook
$10.00
RRP $14.99
Save 33%
Print + eBook
$24.99
RRP $24.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$10.00
$24.99
$29.99 p/m after trial
RRP $14.99
RRP $24.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Box2D for Flash Games Book Cover
Box2D for Flash Games
$ 14.99
$ 10.00
Unity 2017 Game Development Essentials - Third Edition Book Cover
Unity 2017 Game Development Essentials - Third Edition
$ 39.99
$ 10.00
Buy 2 for $20.00
Save $34.98
Add to Cart

Book Details

ISBN 139781849519625
Paperback166 pages

Book Description

Physics games are getting more and more popular, and Box2D is the best choice if you are looking for a free, stable and robust library to handle physics. With Box2D you can create every kind of 2D physics game, only coding is not the fun part, but the game itself.

"Box2D for Flash Games" will guide you through the process of making a Flash physics game starting from the bare bones and taking you by hand through complex features such as forces, joints and motors. As you are learning, your game will have more and more features, like the physics games you are used to playing.

The book analyzes two of the most played physics games, and breaks them down to allow readers to build them from scratch in a step-by-step approach.

By the end of the book, you will learn how to create basic primitive bodies as well as complex, compound bodies. Motors will give life to cars, catapults and siege machines firing bullets, while a complete collision management will make your game look even more realistic.

If you want to make full Flash games with physics, then Box2D for Flash Games will guide you through the entire process of making a Flash physics game.

Table of Contents

Chapter 1: Hello Box2D World
Downloading and installing Box2D for Flash
Hello Box2D World
Defining the Box2D World
Running the simulation
Summary
Chapter 2: Adding Bodies to the World
Your first simulation – a ball falling on the floor
Creating a circular shape
Creating a fixture
Using debug draw to test your simulation
Creating a box shape
Different body types – static, dynamic, and kinematic
Density, friction, and restitution
Creating a Totem Destroyer level
Creating compound bodies
Creating an oriented box shape
Creating any kind of convex polygons
Summary
Chapter 3: Interacting with Bodies
Selecting and destroying bodies with a mouse click
Assigning custom attributes to bodies
Looping through bodies and getting their properties
Summary
Chapter 4: Applying Forces to Bodies
Falling apples, revamped
Force, impulse, and linear velocity
Applying an impulse to get a linear velocity
Applying a force to get a linear velocity
Forces in a real game
Physics games aren't just a matter of physics
Placing the physics bird
Shooting the physics bird
Summary
Chapter 5: Handling Collisions
Checking for collisions
Box2D built-in collision listener
Trace the beginning and the end of a collision
Detect when you are about to solve a collision and when you have solved it
Detecting when the idol falls on the floor in Totem Destroyer
Destroying bricks and killing pigs in Angry Birds
Summary
Chapter 6: Joints and Motors
Picking and dragging bodies – mouse joints
Keeping bodies at a given distance – distance joints
Making bodies rotate around a point – revolute joints
When Angry Birds meets Crush the Castle
Controlling joints with motors
Controlling motors with keyboard
Don't let some bodies collide – filtering collisions
Putting it all together
Summary
Chapter 7: Skinning the Game
Replacing debug draw with your own graphic assets
Summary
Chapter 8: Bullets and Sensors
Experiencing tunneling
Preventing tunneling – setting bodies as bullets
Allow bodies to overlap while detecting contacts with sensors
Summary

What You Will Learn

  • Create a physics world with gravity
  • Manage materials assigning physics properties
  • Interact with physics bodies using mouse or keyboard
  • Build vehicles with joints and motors
  • Handle every kind of collision
  • Add forces and impulses to bodies
  • Turn your graphic assets into physics bodies
  • Fire bullets and destroy bodies

Authors

Table of Contents

Chapter 1: Hello Box2D World
Downloading and installing Box2D for Flash
Hello Box2D World
Defining the Box2D World
Running the simulation
Summary
Chapter 2: Adding Bodies to the World
Your first simulation – a ball falling on the floor
Creating a circular shape
Creating a fixture
Using debug draw to test your simulation
Creating a box shape
Different body types – static, dynamic, and kinematic
Density, friction, and restitution
Creating a Totem Destroyer level
Creating compound bodies
Creating an oriented box shape
Creating any kind of convex polygons
Summary
Chapter 3: Interacting with Bodies
Selecting and destroying bodies with a mouse click
Assigning custom attributes to bodies
Looping through bodies and getting their properties
Summary
Chapter 4: Applying Forces to Bodies
Falling apples, revamped
Force, impulse, and linear velocity
Applying an impulse to get a linear velocity
Applying a force to get a linear velocity
Forces in a real game
Physics games aren't just a matter of physics
Placing the physics bird
Shooting the physics bird
Summary
Chapter 5: Handling Collisions
Checking for collisions
Box2D built-in collision listener
Trace the beginning and the end of a collision
Detect when you are about to solve a collision and when you have solved it
Detecting when the idol falls on the floor in Totem Destroyer
Destroying bricks and killing pigs in Angry Birds
Summary
Chapter 6: Joints and Motors
Picking and dragging bodies – mouse joints
Keeping bodies at a given distance – distance joints
Making bodies rotate around a point – revolute joints
When Angry Birds meets Crush the Castle
Controlling joints with motors
Controlling motors with keyboard
Don't let some bodies collide – filtering collisions
Putting it all together
Summary
Chapter 7: Skinning the Game
Replacing debug draw with your own graphic assets
Summary
Chapter 8: Bullets and Sensors
Experiencing tunneling
Preventing tunneling – setting bodies as bullets
Allow bodies to overlap while detecting contacts with sensors
Summary

Book Details

ISBN 139781849519625
Paperback166 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Kinect for Windows SDK Programming Guide Book Cover
Kinect for Windows SDK Programming Guide
$ 26.99
$ 10.00
Unity Multiplayer Games Book Cover
Unity Multiplayer Games
$ 26.99
$ 10.00
OUYA Game Development by Example Book Cover
OUYA Game Development by Example
$ 23.99
$ 10.00
Marmalade SDK Mobile Game Development Essentials Book Cover
Marmalade SDK Mobile Game Development Essentials
$ 29.99
$ 10.00
DirectX 11.1 Game Programming Book Cover
DirectX 11.1 Game Programming
$ 23.99
$ 10.00
Unreal Development Kit Game Programming with UnrealScript: Beginner's Guide Book Cover
Unreal Development Kit Game Programming with UnrealScript: Beginner's Guide
$ 29.99
$ 10.00