i am a game programmer and i use actionscript to do all my collision checking, boundary checking etc...but recently i noticed there are things called "physics engines" that help me concentrate more on game making rather than physics making. so i would like to know more. i heard there are few engines called "box2dflash" and "APE".

5 Answers
5

There's no such thing as best physics engine. It heavily depends on what you need. Take Box2D as an Example: It is a fully featured 2D Physics Engine, originally developed in C++ and ported to ActionScript. It is great for realistic 2D physics simulation, including gravity, forces, friction, continuous collision detection and much more.

An Engine like Box2D is going to use quite a lot of your CPU cycles, especially when using it in Flash. It is also not trivial to set up and to create appropriate collider-bodies for your Entities.

If you wanted to create a game like Breakout, an Engine like Box2D would be overkill. A game that heavily uses physics for gameplay like Totem-Destroyer, is probably easier to implement when you can make use of a good Physics-Engine though :-)

There are also other implementations like the one provided with the Flixel Game-Engine. It isn't a physics-engine per se, but it contains a solid collision-detection algorithm. The engine also updates entity velocity and gravity.

In most cases, the tools provided by Flixel or similar engines are good enough. Just keep in mind that using a physic engine is going to be CPU intensive and you should choose the implementation that best fits your game.

It uses an Alchemy port of Box2d, meaning it is converted from pure C code using Alchemy which really enhances the performance.

If you are authoring your game in the Flash IDE and not in pure as3, it basically makes the Flash IDE into a level editor by adding components for physics based shapes and joints. Definitely at least worth checking out the demo.

If you are using pure as3, the component classes could still come in handy.

If nothing else, playing with the components in the IDE and messing with the demos would be a nice introduction to using a physics engine and an easy way to familiarize yourself with the concepts.