The idea is Chipmunk Playground. You draw static and dynamic shapes in the editor, then press play and it starts simulating. Press stop and you're returned to edit mode (with everything in its original position). You can export to a Quicktime movie or whatever.
I had a few thoughts about the implementation. I think that segments would be reserved for static bodies. I'd introduce the concept of "materials", where every body is assigned a material. Each material controls surface friction, elasticity, and density. Materials would also control what happens with collisions, e.g. collisions between material 1 and material 1 are ignored, but collisions between material 1 and material 2 take place.
In the future, I'd like to add a third option - collisions between two materials trigger a script. That way, you could make a pretty cool game-making toy. You could make a breakout game by:
- Drawing a box around the arena using segments. Assign material 1 to the bottom one.
- Drawing and duplicating rectangles for the bricks, and making them all material 2.
- Drawing a rectangle for the paddle, and setting its x position to be controlled by the mouse x position.
- Drawing a circle for the ball. Give it an initial velocity and give it material 3.
- Writing scripts that perform all the various actions you'd expect based on the collisions given.
But that's all in the future. To start with, I'd be pretty happy if I could just draw a few (hundred) circles, a few lines for them to bounce off, turn up the gravity, hit play and watch them bounce.
If anyone's interested, I plan to make it a Core Data Document-Based application. The interface will all be Cocoa, but the things that happen in the edit/play window will be C and OpenGL. I've already written quite a lot of code for editing 2D shapes for a previous project, which should speed things up a bit.
So anyway, that's my rambling post about my idea. Hopefully I'll have something done within a week or so to show off. We'll see.