BlackBerry smartphones are not just for business. As it turns out, the
BlackBerry is for gaming, too. We show you how to leverage the
BlackBerry
Java Development Environment (based on Java ME)
to design and create fun and sophisticated game applications, from role playing to a Jedi
knight battle. In this book, we give you the professional techniques for
using music, action, graphics for building gorgeous user interfaces, scalable vector
graphics, basic game actions, peer to peer games, role playing games, and more. Along
the journey, you can take what you have learned to create very cool games, such as
Battlin' Light Saber, a toy sports car driving, and the Fox and Hounds GPS game.
What is so special about the BlackBerry for game development
How to build a custom user interface with your game's theme
How to take your graphics to the next level with SVG and OpenGL ES
How to boogie on down with a MMAPI music player
The differences between MIDlets and BlackBerry's proprietary CLDC applications – how (and why) to write your game as one type or the other
How to optimize your games with BlackBerry-specific APIs and tools
How to program games for any BlackBerry device, from the earliest Java-enabled smartphones to models that run the latest BlackBerry 5 operating system
Tips and techniques for optimizing your game graphics (and drawing your own!)
How to build games for two players or the whole world with GPS, SMS, and the Internet
How to create space adventures that may confound your mind with their awesomeness
How to drive a toy sports car from your BlackBerry using Bluetooth and USB
How to sell your game on BlackBerry App World and beyond
All the book's code is here, either downloadable as a single
zip file (4.34 MB), or on
a chapter-by-chapter basis from each chapter's page.
Last updated: 7th March 2010.
Chapter 2. BlackBerry Application Basics
Why are there two types of BlackBerry Java applications? What are all those
crazy files the compiler generated? And – most importantly – how do I get an
application complied and running on my BlackBerry smartphone? Chapter 2 will
answer all of these questions, plus help you set up a professional build with Ant.
Chapter 3. Game Graphics and Events with MIDP and RIM Classes
Using the classic Maze game as an example, you'll see exactly how the two types
of BlackBerry Java applications differ. You get an in-depth look at how the
lifecycle, events, and graphics work in both cases so you'll be ready to develop
whichever kind is best suited to your game's needs.
Chapter 4. Adding a Professional Look and Feel
Gorgeous graphics are critical for the game experience. To get your game's visual
theme pixel-perfect on every model, BlackBerry gives you the tools, and Chapter 4
explains how to use them.
Chapter 5. Security and Selling Your Game
As much as you love games for their own sake, at the end of the day it's nice
to get paid. In Chapter 5 you'll see how to sell your game on BlackBerry App World
(or on your own site) – plus how to apply the cryptography APIs to implement
licensing and Digital Rights Management.
Chapter 6. Swingin' Light Saber
With action, music, sound-effects, colliding game sprites, and even touch-screen
input, Andrew shows you how to put it all together and develop a real game.
Plus BlackBerry's accelerometer lets you wield your saber like a true RIM-i Knight!
The second half of this book takes you beyond the basic games. See how exciting
games can be when you add a little imagination to advanced features like 2 and
3-D graphics, network communications with other players, GPS, and more!
Chapter 7. Play a Live Opponent with SMS
That classic, tiny packet of data sent by the Short Message Service is still
a favorite with users and operators alike. And it's all you need to play a
trans-atlantic game of Checkers with a friend – chosen from your BlackBerry
contact list!
Chapter 8. Using Scalable Vector Graphics
2-D graphics are easy to master and allow you to create surprisingly impressive
effects. Check out Chapter 8's spinning spaceship video and learn the tricks
to create it.
Chapter 9. Creating Role-Playing Games on the Internet
Since Internet everywhere is BlackBerry's strong point, it was practically
born for Massively Multiplayer Online Role-Playing Games (MMORPGs)! Chapter 9
uses Twitter to create a virtual asteroid belt that you can explore and find
real people in their own virtual ships.
Chapter 10. Remotely Drive a (toy) Sports Car
What's more fun than driving a remote controlled car? Driving one from your
BlackBerry! Andrew illustrates Bluetooth programming in style.
Chapter 11. Fox and Hounds
Here's something your stationary game console can't do: a real live game of hot
pursuit – based on GPS!
Chapter 12. Introducing 3D with JSR 239
Have a look at what the latest-and-greatest version 5 BlackBerry smartphones can do!
Andrew explains 3-D graphics with OpenGL.