Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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".

share|improve this question

closed as off-topic by Byte56 Jul 9 '13 at 16:51

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions that are about "which tech to use" are outside the scope of the site. For more information, see this meta post" – Byte56
If this question can be reworded to fit the rules in the help center, please edit the question.

'Best' is rather subjective. Do you mean easiest to use, fastest, or most elegant? – The Communist Duck Jan 9 '11 at 11:13
up vote 5 down vote accepted

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.

share|improve this answer
Heh, totem destroyer is fun! – drxzcl Aug 15 '10 at 9:19

If you are looking into box2d at all, be sure to check out World Construction Kit.

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.

share|improve this answer

Box2d is used in a lot of games, also outside of the flash world. It was made originally in C and has been ported to a lot of languages, from objective-c to javascript.

I think it's a testiment to the engine which is very easy to use, has good documentation, loads of examples (although sometimes in different language) and is very fast.

The only downside is that it is limited to 2d. But this downside is a plus if in fact you are making a 2d game (which most of the time is the case in flash world probably)

share|improve this answer

As others here have said, Box2D is a pretty full featured physics engine, although it does take a lot of work to get it set up properly.

And as others here have said again Box2D is resource intensive.

Also I can almost tell immediately if a game uses Box2D, because of the way the physics behaves.

So my approach is to make my own small physics engine that looks unique when compared to other games, is easier for me to work with, and easier to wrap my head around.

share|improve this answer
well, i cant make a physics engine because i do not know how. I learned there are engines called APE and fisix, which would you recommend? – Vishnu Aug 16 '10 at 7:03

Go with box2d, ape and fisix projects you mentioned are both dead. Box2d for flash has to one of resources and by learning it youre learning something you can take to almost anywhere.

I've made games in Ape it was good but as I said it's a dead project. I've made games in box2d, it's more upfront work but your returns are solid.

To the person who mentioned they could tell a game used box 2d by how it felt. I really doubt that, if anything you could tell it is using some kind of rigid body physics engine but that's about it.

Also check out motor2, another box2d port by a really smart guy.

Sent on iphone

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.