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

Vlad: Make sure the Box2DAS/Box2D.swc library is included in your project, and also that the Box2DAS folder is in your classpath. Beyond that... make sure you call b2Base.initialize() and use like you would the normal Box2D library!

secoif: Should not be hard. Will look into today.
Mayo?

What is the Actor framework you are implementing?

I noticed from way back people go on about Actors but i never understood the context.
I think "Actor" means a lot of different things to different people. I'm working on an actor framework the handles ground / wall detection, jumping, moving, etc. but it is more meant as a reference implementation that anything. There's no way to factor out all the different AI people want to implement in their game. Basically if you want to add AI to your BodyShapes, just subclass BodyShape and setup an update loop like so:

Code:
public override function create():void {
    super.create();
    listenWhileVisible(world, StepEvent.STEP, gameLoop,  false, 1);
}

public function gameLoop(e:Event) {
    /* do stuff */
}
Update:

* BodyShape component properties are now getters / setters - changing them will effect your live b2bodies / b2shapes.
* SetFilterData implemented. See the "Filter" test bed for an example (the implementation is slightly different than the other versions).
mayobutter wrote:
Vlad: Make sure the Box2DAS/Box2D.swc library is included in your project, and also that the Box2DAS folder is in your classpath. Beyond that... make sure you call b2Base.initialize() and use like you would the normal Box2D library!


Got it! 🙂 Exploring it right now!
mayobutter wrote:
Update:

* BodyShape component properties are now getters / setters - changing them will effect your live b2bodies / b2shapes.
* SetFilterData implemented. See the "Filter" test bed for an example (the implementation is slightly different than the other versions).


mayobutter: thumbs-up to your last commits, you just made my day. Those were exactly the two things that were bugging me. Thanks heaps
Nice update! Quick bugfix though: there's a compiler warning for an untyped parameter on SetFilterData within b2Fixture.
kinda a noob question but.
when lets say i drag a couple of boxes to stage does WCK sends
them into some sort of an array?
i kinda need to run a function for the box2d children on stage
thanks
As we already know, WCK is a fantastic engine. Beside the WIKI, there is no documentation that I can find that details the methods available. Obviously I could rip through the classes and try to figure it out, but in the interest of time that's not optimal.

Does anyone have a basic or comprehensive list available, or basic use examples? Thanks.
Quote:
Does anyone have a basic or comprehensive list available, or basic use examples? Thanks.

I strongly recommend reading the Box2D manual to get a grasp on the core concepts, then picking apart the demos to get a sense of what WCK is capable of.
Quote:
when lets say i drag a couple of boxes to stage does WCK sends
them into some sort of an array?
i kinda need to run a function for the box2d children on stage

You could either loop through the display object list of the world and identify BodyShape instances, or use b2world->GetBodyList() to loop through all the bodies and pull the BodyShape off each b2body's UserData.

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