PushButtonEngine: Complete Box2D + XML Loading Demo
I created a new demo. Download it, add your own (free) PBE swc file from Pushbuttonengine.com, and test the demo!
Here is a simple but complete Box2D physics example. A FLA file contains the skins for the 2 objects. XML loads the entities and puts the on the screen. Click with the mouse to create a new Box2D object. Cool!
As an FYI, I built it from the PBE source code (as files) on GIT as of a week before this post. Not sure that matters. Add your own source or swc for PBE to my file (attached).
FLEXIBILITY
* You can change the xml and the main document class easily to adjust the position and number of objects. Go for it!
* You can also comment out the debugger code in the xml (see a comment in that file) to remove the debug-outlines (boxes shown around the box2d objects). The debugger is helpful for learning, but not desirable in your final game.
Next Steps
- Follow comments and add your own comments on the PushButtonEngine Forums.
- Question – Click the mouse button. The star shows for 1 frame VERY large, then changes to the desired size. How can I eliminate the odd sizing on that first frame (ideally) or hide (acceptable workaround) the object for that one first frame?
- Question – The center of the screen is 0,0. How in XML can I make the 0,0 be the upper-left of the stage (like Flash/Flex generally has it). Please test your suggestion in the attached zip and then post your answer here. Thanks so much!
Member Resources
You must be a 'Free Member' to see this content. With your access you will enjoy members-only content like this, HD video tutorials, and access to complete source code.
Ready To Join?
- Sign up for 'Free Member' level now. Its free!
- Sign up for 'Paid Member' level to enjoy much, much more! (Invite Only)
- Log in and enjoy!













Leave a Reply
Want to join the discussion?Feel free to contribute!