BelligerentBlocks showcases the Scoreloop™ social gaming platform (wikipedia) and many BlackBerry® PlayBook™ features (OpenGL ES, OpenAL, SQLite3) and leverages our port of Box2D. This post describes how to download, build and install BelligerentBlocks on your PlayBook.
Same arrangement as in previous posts: the target is a consumer (i.e. secure) PlayBook Tablet, running the latest public beta release 220.127.116.1111 (see instructions) and the host is a Mac laptop running MacOS using the NDK 2 beta 3 tools.
I installed a debug-token to avoid having to sign the applications during the “development” cycle.
Building Belligerent Blocks
You will need two packages from our GitHub repo: Box2D and the actual BelligerentBlocks. We will use the (Eclipse-based) IDE to build, package and install the application.
Box2D is its own GitHub repository. You can clone the repo or just download the ZIP file for the master branch. The clone takes longer as it pulls down all branches and the full repo history. Either way, you will get the Eclipse project information, so import the project into your IDE. I used the master branch.
BelligerentBlocks is part of the NDK-Samples repository. The corresponding subdirectory is also a complete Eclipse project, so also import that project into the IDE. For this we need to use the next branch, since that corresponds to the PlayBook 2.0 runtime.
Next, build the two projects, first Box2D, then BelligerentBlocks. They should build without issues.
Next is to configure the target configurations. One way to do this is to run BelligerentBlocks, which will automatically prompt you:
Configure the target, in this case connected via USB:
Now you are pretty much ready: select the BelligerentBlock project and Run-As… and wait while the application downloads:
Run and Enjoy
And you are ready. The application starts and connects via the Scoreloop API. It will ask you for an id which will later use to share scores, and it will start:
A score ranking appears at the end of the game. The first two are cheats, but the rest are real. The maximum score is 1000, see how close you can get.
Enjoy! And browse the code to learn how easy it is to use the Scoreloop API.