Flash AS3 Tutorials Center | Interesting Flash Animation Tutorials | Valuing Flash Animation Tutorials | Flash ActionScript and Animation Home

AS3 Beginner Tutorials | AS3 Basic Lessons | AS3 Valuing Courses | AS3 Components Tutorials | AS3 and PHP Interaction Tutorials
AS3 Practical Tutorials | AS3 Animation Techniques | AS3 Transition Effects Tutorials | AS3 Download Upload Files | AS3 Particle Systems
Communication Between Flash Movies with AS3 | AS3 and JavaScript interaction | AS3 Matrix Transformation | AS3 Physics Simulation Tutorials

Physics Engine Simulation Flash ActionScript Tutorial

Physics Engine allows simulation of the physics world (e.g. falling objects, object sliding down a slope, bouncing objects, etc.) easily without writting extensive Flash ActionScript codes. There are some Flash ActionScript 3 Physics Engines on the Internet. This is better to choose the most suitable Physics Engine to suit your needs. In our flash actionscript tutorials, we use Box2D Physics Engine to do some physics simulation with a lot of interesting examples.

Steps in Simulating Box2D Physics World

You can use Flash ActionScript 3 code to create very interesting Physics Systems, for example, sliding slope, falling objects, bouncing object, prismatic engines joints, etc. It requires more knowledge of ActionScript. Therefore this is better to learn other flash actionscript tutorials before starting this topic.

Step 1: Create a Virtual World
Every Box2D program begins with the creation of a world object with definition of gravity and sleep. This is the physics hub that manages memory, objects, and simulation.

Step 2: Create Ground or Floor
Now we have our virtual world. There is nothing in our world. The first thing we need to add to our world is the ground (earth or floor). This step is optional. You can simulate a physics world without a Ground.

Step 3: Create Dynamic Bodies
To simulate the physics world, we have to add at least an dynamics object (e.g. falling box) to our world. The techniques in creating the Ground body and Dynamic Bodies are the same EXCEPT that we must establish the dynamic body's MASS properties. The basic mass properties of dynamic bodies are density, restitution and friction.

Step 4: Simulate Our Physics World
Now we have all necessary objects, the physics world is ready to simulate. You need to define the frame rate and the iterations to do the simulation.

All our tutorials of Flash ActionScript 3 Physics Engine show detailed codes with steps by steps. Okay, let's get started.......

Remarks:

This Flash ActionScript tutorial shows how to simulate a Physics world with Box2D Physics Engine.