AS3 2.1 Port (Alchemy), WCK Update and Kinematic Demos

The convex decomposition is fantastic! It's great being able to allow any shape to be created at runtime with no fuss. Is there a way to get it to stop tracing the number of edges of each fixture when it is run though?

EDIT: One more request if you are still taking them... would it be possible to implement TestPoint on b2Shape?
EDIT2: Disregard that, I was looking at b2Shape and saw the dummy TestPoint function, completely forgetting it would get overridden in the derived classes b2PolygonShape and b2CircleShape. I'll continue to let you know if I find any bugs, but so far things are looking good!
hey again awesome work:)
i have two quick questions:
1. how can i add the "hand cursor" over draggble items? (like buttonMode true)
2. what event the "pellet" dispatches so i can "grab" it to add points?

thanks. and again awesome work
shock-value: I'll remove the trace statement in the next update.

arkzai:

Re #1: I haven't confirmed this, but it looks like you'll just need to set buttonMode = true and useHandCursor = true. You could hack the core BodyShape class's "create" function to add something like this:
Code:
if(allowDragging) {
    buttonMode = true;
    useHandCursor = true;
}

Or subclass BodyShape, override the "create" function and put this code there. This might not be a bad thing to have in core though. I'll think about it... personally I'm planning on implementing my own graphics-based cursors.

Re #2: Take a look at the "BoxMan" class. These are the relevant pieces of code:
Code:
public override function create():void {
    reportBeginContact = true; // Tell the bodyshape to dispatch begin contact events.
    super.create();
    listenWhileVisible(this, ContactEvent.BEGIN_CONTACT, handleContact); // Listen for those events.
}
      
public function handleContact(e:ContactEvent):void {
    var p:Pellet = e.other.m_userData as Pellet;
    if(p) { // Is the other object a pellet?
        p.remove(); // Remove it and increment my point tally.
    }
}

So you're actually listening for events off of the main character, not the pellet. You don't want the pellets/collectibles dispatching contact events because that's a lot of wasted events.
thanks a lot.
guess i looked for love in all the wrong places 🙂
Is it possible to just use the Alchemy port of the code in my own project? I can't figure out how to get it working. I'm using FlashDevelop, and have the ported SWC, but I get a "Wrong Central Directory Signature" error.
Yes, you can use the Alchemy port on its own. The TestBed project does this. You just need to include the Box2DAS.swc file and have the Box2DAS folder in your class path. I have no idea what the "Wrong Central Directory Signature" error is. I also have no experience with FlashDevelop (I'm on a Mac). I know some other people have got it working with FlashDevelop though; anyone care to lend some tips?
Awesome thanks, got it working now. I stupidly forgot to add the Box2DAS3 to my class path. Now I got to convert a bunch of stuff over. Also, not sure if you're aware, but there seems to be a typo in b2contact.as: the function GetManifold() says GetManidold().
lol, thanks. Will be fixed in the next update. I've got the latest version up to date with SVN and will post soon, but Erin made some huge changes that I'm struggling with: viewtopic.php?f=4&t=4357
dear mayobutter,
you win 😢

I've been building my own little game engine around box2d for the last year or so.
never really got into joints or special shapes heavily.
also haven't ported my engine to use 2.1 yet.

looking into your engine (i've been putting that off for a while)
i realize that my latest improvements to my engine make it so very similar to yours. and wck is much farther along.

was not aware that wck supported building maps in the flash IDE, which was my primary focus for quite a while, to allow artists to build games easily.

it also took me a long time to accept that box2d was a better faster physics engine than i was ever likely to make. but i have been much happier since my switch to box2d and i think this may be the same.

dramatization aside... now my question is
How can i help?

  • is there a wiki (and or forum) devoted specifically to wck?
  • does wck load external assets?
  • or have a map editor?
Sketchbook: Nice to see some interest in the high-level WCK stuff. Most people are just gutting it for the Alchemy port.

Quote:
is there a wiki (and or forum) devoted specifically to wck?

The GitHub wik is a starting point and anyone can add to it. Documentation is severly lacking.

Quote:
does wck load external assets? or have a map editor?

Well, isn't that what Flash is for? The whole point is that you can load all your assets and layout your game in Flash. Or do you mean edit the map during runtime?

What do you want to see added to / changed in the framework? Most of the features are the result of me needing something for the game I'm developing, or dreaming up some wild feature just to see if it can be done. I'm not adverse to including other peoples code / features (if it is for the better) so if there's something you want to hack at go for it.

I'd also really like some constructive criticism on how things are structured. There are some things I'm unhappy with (like how World extends Scroller, but not all games need scrolling capabilities) but I don't bother fixing because there is no pressure.

Original thread: https://box2d.org/forum/viewtopic.php?t=4105