I've read the docs/ folder, and now I can create a QuickB2 project in FlashDevelop with all the correct dependencies.
But what I'm really interested in now is how to visually edit the physic.
I can see it's related to this file fla/qb2VisualEditorLibrary.fla so I made a copy in the same folder and opened it in Adobe CS 5
I then added a ProxyRectShape onto the stage, set its mass property to 1 and launched it. The box is there but it doesn't fall ?
Do I need to define gravity somewhere ? Create the physic world ? Have I forgotten something else ?
Ah another good question would be,
How do I use the qb2FlashLoader to load the physic from the gui ?
I really can't figure it out and there's no example
Hi Vlad,
Thanks for your interest and questions. A few people have been asking for a similar example, so it's high time that I put some focus into the Flash CS5 side of things. If you check back tomorrow (in like 20 hours), I should have a working example committed on SVN. It's quite easy to pull together itself, but there's a bunch of house-keeping stuff I need to do first, so it'll take me some more time.
Thanks,
Doug
Sorry, the housekeeping is taking longer than expected. You have the right idea though with qb2FlashLoader. The loadObject function takes a qb2Proxy instance (subclass of MovieClip) and spits back a qb2Object which can be added to a qb2World. QuickB2/fla/qb2VisualEditorLibrary.fla has an Examples folder inside with a fox-thing you can load. You can also load TriangleShape, CircleShape, and some others as is. On your timeline, you can create a world, use qb2FlashLoader to convert a MovieClip to a qb2Object, then add that object to your world.
I'll have an example done tomorrow hopefully. It's definitely a top priority.
Alright, thanks for the follow up !
I'm definitely looking forward to the example.
I haven't worked too hard on your explanations, but as I'm new to flash I have trouble understanding 2 things:
- how to get a qb2Proxy from the .fla
- how to add a world to my timeline (I thought I had to create it manually in FlashDevelop)
I'm sure it will be much clearer when your example is out
Alrighty, I got a simple example committed on SVN. QuickB2/fla/qb2VisualEditorLibrary.fla now produces a simple simulation with bitmaps. Check on the main timeline for the few lines of ActionScript 3.0 you have to write to get started.
Eventually I'll make a more formal example for Flash CS5 and put it in the examples/ folder, but for now that should at least get you started. Feel free to ask more questions.
Eventually I think you'll want to use FlashCS5 only for making your game assets, and write code in an editor like FlashDevelop or FlashBuilder. In this case, you can have FlashCS5 create a .swc, then you import this .swc into your FlashDevelop/FlashBuilder project. FlashCS5 compiler really sucks...takes forever.
Hi Doug,
How to create motors in QuickB2?
I have qb2RevoluteJoint, but I don't know how to create a motor.
Thanks,
Vladimir
Hi Vladimir,
Do you mean visually create, with FlashCS5? Or through code?
- Doug
Through code.
In Box2DFlashAS3 some joints provide motors which can be used to drive the joint at a prescribed speed until a prescribed force/torque is exceeded.
I have not found how to create motors in QuickB2.
Thanks.