Tutorial: Create the Falling Blocks application
In this tutorial, we'll explore the Falling Blocks sample application that is included with the BlackBerry 10 Native SDK. This application demonstrates how to perform common tasks such as handling touch, navigator, and sensor events, working with application data, and rendering content to the screen. For rendering, this app uses the Glview Library, which is defined in glview.h.
When this application starts, a single block appears on the screen and falls from the relative top of the screen to the relative bottom, depending on the orientation and pitch of the BlackBerry 10 device. A user taps the screen to create a new block at that position. The new block begins falling immediately. The blocks always fall from one side of the screen to the opposite side, even when the user changes the orientation of the device.
You will learn to:
- Create the Falling Blocks project
- Initialize OpenGL ES using glview
- Set up a main application loop
- Handle touch, navigator, and sensor events
- Update application data and render the scene
- Clean up application resources properly
How to use this tutorial
This tutorial walks you through the Falling Blocks application and explains the purpose of each section of code. You don't need to type any code yourself; it's all included in the main.c file of the Falling Blocks project. You can open that file in the Momentics IDE for BlackBerry and follow along using the code samples that are provided throughout the tutorial. Alternatively, you can download the completed FallingBlocks project.
Last modified: 2013-10-30