Multi-Player MIDP Game Programming

Multi-Player MIDP Game Programming This tutorial explains how to write multi-player games for MIDP phones. It describes the technologies that are available to support multi-player games, and shows what kinds of games are possible with these technologies. Click here to view “Multi-Player MIDP Game Programming”

Developing Applications with the Java APIs for Bluetooth (JSR-82)

Developing Applications with the Java APIs for Bluetooth (JSR-82) This paper covers the Java API for Bluetooth (JSR-82) with respect to Sony Ericsson devices. It starts by introducing the Bluetooth technology, followed by the Java APIs for Bluetooth, and how to use them. Currently, these APIs are currently available in the Sony Ericsson P900/P908 handsets. […]

Real World Experiences with the WMA and the Push Registry

Real World Experiences with the WMA and the Push Registry Introduction This article will recount my experiences on a recent project that involved use of the Wireless Messaging API (WMA) and the Push Registry. The Push Registry is a feature new to the MIDP 2.0 spec, and the WMA, while not a MIDP 2.0 feature, […]

J2ME Game Optimization Secrets (part 5)

Other Techniques One technique I was unable to include in my example code was the optimal use of a switch() statement. Switches are very commonly used to implement Finite State Machines, which are used in game Artificial Intelligence code to control the behavior of non-player actors. When you use a switch, it is good programming […]

J2ME Game Optimization Secrets (part 4)

Low-Level Optimization All programmers are familiar with the concepts of the sub-routine and the function – separate out common code to avoid duplicating it in several places around your app. Unfortunately, this commonly “Good” programming practice can impact performance because method calls involve a certain amount of overhead. The easiest way to reduce the amount […]

J2ME Game Optimization Secrets (part 3)

Out of the loop? Code inside a for() loop will be executed as many times as the loop iterates. To improve performance, therefore, we want to leave as much code as possible outside of our loops. We can see from the profiler that our paint() method is being called 101 times, and the loop inside […]

J2ME Game Optimization Secrets (part 2)

Where to Optimize – the 90/10 rule In performance-hungry games, 90 percent of a program’s execution time is spent running 10 percent of the code. It is in this 10 percent of the code that we should concentrate all of our optimization efforts. We locate that 10 percent using a profiler. To turn on the […]

J2ME Game Optimization Secrets (part 1)

This article describes the role that code optimization plays in writing fast games for mobile devices. Using examples I will show how, when and why to optimize your code to squeeze every last drop of performance out of MIDP-compliant handsets. We will discuss why optimization is necessary and why it is often best NOT to […]

MIDP 2.0 Games: a Step-by-Step Tutorial with Code Samples (Step 6)

And here’s the code for Tumbleweed.java: package net.frog_parrot.jump; import java.util.Random; import javax.microedition.lcdui.*;import javax.microedition.lcdui.game.*; /** * This class represents the tumbleweeds that the player  * must jump over. * * @author Carol Hamer */public class Tumbleweed extends Sprite {   //———————————————————  //   dimension fields   /**   * The width of the tumbleweed’s bounding square.   */  static int WIDTH = 16; […]

MIDP 2.0 Games: a Step-by-Step Tutorial with Code Samples (Step 5)

The Sprite Class A Sprite is a graphical object represented by one image (at a time). The fact that a Sprite is composed of only one image is the principal difference between a Sprite and a TiledLayer, which is a region that is covered with images that can be manipulated. (The Sprite class has a […]