Before you begin

You should have the following things ready:

  • The BlackBerry 10 Native SDK
  • Your BlackBerry 10 device or simulator ready for testing
  • A basic understanding of the C language and some experience running applications with the Native SDK

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.

Create your project

To get the Falling Blocks application up and running, you need to create a project.

  1. In the Momentics IDE for BlackBerry, on the File menu, click New > Example.
  2. Click BlackBerry Example Project and then click Next.
  3. Select BlackBerry 10 OS Example Falling Blocks Project and then click Next.
  4. Verify that you'd like to create the project in the default location, or clear the Use default location check box and select a different location for the project.
  5. Click Finish.

The project appears in the Project Explorer window in the IDE. To see the source files in the project, you can expand the project folder and then the src folder.

After you've created the Falling Blocks project, you can build and run the application to see what it looks like in action.

Using the application

In the Falling Blocks example application, users control the number of colored blocks that appear on the screen, as well as the direction of travel of the blocks. Users can interact with the application in several ways:

Action

Result

Tap the screen with one or more fingers.

Add one or more blocks to the screen. The blocks start falling immediately.

Adjust the pitch and orientation of the device.

Alter the direction of travel of the blocks. The blocks always fall from the relative top of the screen to the relative bottom, depending on the pitch and orientation of the device.

Swipe down from the top of the bezel.

Clear all blocks from the screen.

Last modified: 2014-05-14



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus