Box2d Flash with WCK
Hello and welcome to my very first talk about Box2D. I'm Yarek, one of the computer programmers who have been messing up with Box2d for Flash. In fact I'm dedicating this speech to talk primary about WCK ( World Construction Kit ). I imagine that some of you have already heard these names. Box2D is basically the two-dimensions engine by excellence and is been ported to several programming languages, in this case we are making an approach to the Action Script 3.0 version. WCK it's just an easy way to use all this complex engine using the Flash Professional CS5 IDE, which is amazing and worth trying.
In about two hours you can have a character that is able to move around the screen, also capable of jumping and all of this with collisions with the environment in a very realistic way. Anyone who has tried to do something like this knows perfectly that this is not duck soup. Especially the fact that it must be both realistic and well optimized.
For all of this, my recommendation goes for WCK because it's without any doubt the easiest and fastest way to start working with box2D and to internalize all the concepts it works with.
It must be clear that Box2D uses a lot of physics concepts that you may not know or don't take into account very often and that can induce to an error. This is the case for example of friction that is the parameter which determines the grade of touch between two bodies ( it uses this parameter from both bodies to determine the result ) but this doesn't create the force opposite to our movement that we could expect. This is reserved for “damping”. That's the reason that you must use both parameters at the same time if you want to achieve the effect expected.
There's another doubt that will probably emerge when we use WCK and this is the mass. There's not a parameter which such name in WCK but it is in box2D and it's used for lots of calculations. This is in order to get more consistence in the game and also more realism using the density instead of the mass. So it calculates density per area of the object to obtain it's mass.
Anyway it's important to know that we can assign an specific mass using AS 3.0 if we require that. To get this we must include this lines in our physical object definition.var masa:b2MassData = new b2MassData();
masa.mass = 0.27222222089767456; // You set here the value
this.b2body.SetMassData(masa);
This is it, no I just want to thank all the people who have made possible box2D, it's flash conversion and also the World Construction Kit.
If you have any doubt or suggestion I'll be pleased to answer it.
See you !




Comments
Look for power. If there
Look for power. If there isn't pacquiao vs bradley anywhere to plug in the laptop, it might drain its reserves quickly; this also shortens the life of the battery when using pacquiao vs bradley live streaming it more frequently. Calculate this into your decision.
Post new comment