Diamond Rush Game For Nokia X2-01 320x240 -
// Tile types private static final byte TILE_EMPTY = 0; private static final byte TILE_WALL = 1; private static final byte TILE_DIAMOND = 2; private static final byte TILE_PLAYER = 3; private static final byte TILE_EXIT = 4; private static final byte TILE_EXIT_OPEN = 5;
public class DiamondRush extends MIDlet implements CommandListener, Runnable { private Display display; private GameCanvas canvas; private Command exitCommand; private boolean running; private Thread gameThread; diamond rush game for nokia x2-01 320x240
private void movePlayer(int dx, int dy) int newX = playerX + dx; int newY = playerY + dy; // Tile types private static final byte TILE_EMPTY
// Place exit door at bottom-right area int exitX = WIDTH-2, exitY = HEIGHT-2; while (map[exitY][exitX] != TILE_EMPTY && exitX > 1 && exitY > 1) exitX--; exitY--; map[exitY][exitX] = TILE_EXIT; Runnable { private Display display
