The purpose of this framework is to allow developers to build cross platform 2D games.
It is made of three main components:
XUI2D (B4A + B4J) / iXUI2D(B4i) - wrappers for Box2d. Box2d is a powerful physics engine. If you are not familiar with Box2d then it is recommended to start with its manual: http://box2d.org/documentation/
XUI2D: https://www.b4x.com/android/forum/threads/b4x-xui2d-box2d-game-engine.95208/
BitmapCreator - Cross platform class, mostly written in B4X, that can make fast drawings.
Latest version of BitmapCreator is available in the XUI2D thread.
X2 classes - A set of B4X classes that tie all things together.
Currently it is made of:
- X2Utils - The main class with the game loop implementation and various utility methods.
- X2BodyWrapper - Wraps B2Body objects and adds useful features.
- X2SoundPool - A class that hides the differences between the various low latency playback libraries in the different platforms.
- X2DebugDraw - "debug draw" implementation. Very useful to better understand what happens in the physical engine.
- X2SpriteGraphicCache - Manages a cache with the various graphics. This is a very important class and it is critical for the game performance.
The various classes and their usages will be explained in the next tutorials.
You can try the two attached examples. Note that all the classes are identical between the three platforms. It should look like this, with the grey paths:
The difference between the projects is in the layout files and the code in the main module.
Two examples are currently available:
- Hello world, the projects are attached.
- Walking character:
www.b4x.com/b4j/files/games/B4A_WalkingCharacter.zip
www.b4x.com/b4j/files/games/B4J_WalkingCharacter.zip
The B4i projects will be released when the next version of B4i is released.
Attachments
Last edited: