Before you begin

You should have the following things ready:

  • The BlackBerry 10 Native SDK
  • Your BlackBerry 10 device or simulator ready for testing

This tutorial walks you through the Falling Blocks app and explains the purpose of each section of code.

Create your project

To get the Falling Blocks app 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 app to see what it looks like in action.

Using the app

In this sample app, the user controls the number of colored blocks that appear on the screen, as well as the direction of travel of the blocks. The user can interact with the app 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: 2015-03-31



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

comments powered by Disqus