BorisTheBrave wrote:
But still, I'm not sure I like the idea of hacking on Alchemy. Take controllers. They were a breeze in AS3. A bit worse in C++, as I was obliged to use the definition-factory method of allocation. Now I want to add another feature to controllers - you specify an iterator of bodies for them, instead of a manual list. There are 4 iterators initially available - manual, all, inside an AABB, and touching a sensor. It's mainly completed in AS3, and quickly, but I would be hard pushed to write it at all in C++ without introducing some of the higher level features of the language. I could keep that all in the AS3 layer, but you've repeatedly said that it's bad to go frequently between the layers, which that would be doing a lot.
Actually, the controllers I included are in AS3 🙂. They are a slightly different implementation than your own though because I had my own ideas I wanted to try out. I'm really interested in the iterators idea though - especially linking to a sensor. Do you have them in SVN yet?
One idea I'm pondering: Making the "time step" be an AS3 event, and controllers would just listen for that event. That way they could use listener priority to define the order they're called, and even specify to be called before or after the time step. A lot of the high level stuff I'm working on could then be ported to controllers.
My primary purpose for this port is selfish: I'm working on it for my own game. The Box2D community comes second 🙂. So I may end up putting some weird stuff in it...
BorisTheBrave wrote:
BTW, amongst the things on my todolist, there is making BodyDef and FixtureDef optional. That probably goes double for Alchemy, if you think think the definitions are a pain. They have really little benefit in AS3.
I explored this idea at some point but ended up failing. I think it was because the definition properties don't really map 1 to 1 to the body / fixture / etc. properties. Probably could have worked with more thought though.