Box2DWith

Mon, 02/09/2009 - 19:38 — Boris
Box2DBox2DFlashFlash

Announcing my newest finished project, Box2DWith. I'm collecting together various utility classes for doing all the stuff with Box2DFlashAS3, but found annoying. Demo, Docs

Features

At the moment, there are three things you can use Box2D with (hence the name): XML, Graphics and the Flint particle system.

XML

You can now load Box2D definitions from XML files. The XML simple, matches Box2D's design, and is feature complete with Box2DFlashAS3 2.0.1. A scheme is provided with the help docs.

You can load whole worlds, or just partial definitions, so you can use this utility in sympathy with your own loading techniques.

Graphics

I reworked a reasonable subset of b2DebugDraw to work much better with the Flash API. Neat because it's pretty common to want to draw things using shapes as the basis, but b2DebugDraw makes this impossible. My version makes it easy to persist a unchanged body inside a Sprite, and also to style things more or less arbitrarily.

Particles

The Flint particle system, it is a pretty cool particle engine. It's simple to use, but powerful. I like it because it is modular, in fact modular enough that Box2D physics bolts onto it very nicely.

Using the classes provided in Box2DWith/Flint/ you can combine the two in a variety of ways. If you provide just one of BodyRenderer or Collide, then you can update bodies based on particles or visa versa, but if you use both, then properties are shared between them nicely the two systems. You can use all of Flint's "Activities" while still retaining all of the physics working correctly.

For Flint only users, I've simplified the process. Attach the Physics action, and an initializer that gives particles a body, and you are good to go.

Usage

The above gives you an overview of what is available. The ASDoc generated help should instruct you on the specifics. The help is available here, and also in the download. Plus there's a small example demo.

AttachmentSize
Box2DWith.zip682.58 KB

Thanks

Thanks man. I have been waiting for your XML parser. It will certainly help in getting Worlds up and running. I also wish to build upon it for a WYSIWYG Box2D Editor.

very cool

Especially the Flint combination sounds cool! I wish I had time to use this to the fullest, in many more projects, but you have to do projects one at a time, right? :D

I really admire your hard work for the community.

Yeah quality

I just got a hold of flint for the first time, completely unrelated and i end up back at BorisTheBrave!

I agree with Android in that your contributions are very much appreciated.

Thanks

Thanks! These are the exact things I need in my next project!

I love reading books, but

I love reading books, but then after I witnessed great stories into this site, I might just give a little rest to purchasing some novels.
Behance

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.