Cocos2d-x is an open-source 2-D game framework that simplifies the creation of animations, user input, and other aspects of the game development process. This tutorial will help you familiarize yourself with the HTML5 port of that framework, Cocos2d-html5, to create apps for BlackBerry 10.
You will re-create the BoxQuest sample app available on GitHub, and you can find the finished versions of the files we're working with there. In BoxQuest, you navigate the hero, which is rendered as a green square, across a one-screen level, collecting yellow coins along the way.
This is a long tutorial, so it's divided into four sections. We will check your progress in an emulator at the end of each section to make sure everything is working the way we want.
You will learn to:
- Create a basic app using Cocos2d-html5
- Populate the app with a background and sprites
- Apply physics to the app
- Implement touch controls for the app
Before you begin:
- Download and install the Google Chrome browser, which you require to run the Ripple emulator.
- Download and install the Ripple emulator, which is used to preview your app.
- Download the Cocos2d-html5 game framework from GitHub.
- Download and install a tile map editor. This tutorial uses Tiled, and some of the steps may be different for other programs.
- Download a physics engine. This tutorial uses Box2dWeb, and other engines may require a different approach in the code.
When you move on to creating your own apps, download the BlackBerry 10 WebWorks SDK to package them. For more information, see Preparing to package.
Last modified: 2014-03-10