Diamond Rush Game For Nokia X2-01 320x240 Link
if (target == TILE_DIAMOND) // Pick diamond diamondsCollected++; map[newY][newX] = TILE_PLAYER; map[playerY][playerX] = TILE_EMPTY; playerX = newX; playerY = newY;
// Place player at (1,1) map[1][1] = TILE_PLAYER; playerX = 1; playerY = 1; diamond rush game for nokia x2-01 320x240
private void newGame() generateRandomLevel(); diamondsCollected = 0; exitOpen = false; gameState = STATE_PLAYING; map[newY][newX] = TILE_PLAYER
class GameCanvas extends Canvas private int menuSelection = 0; map[playerY][playerX] = 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;
// Place diamonds (count = 15-25) diamondsTotal = 15 + random.nextInt(11); int placed = 0; while (placed < diamondsTotal) int x = 1 + random.nextInt(WIDTH-2); int y = 1 + random.nextInt(HEIGHT-2); if (map[y][x] == TILE_EMPTY && !(x == 1 && y == 1)) map[y][x] = TILE_DIAMOND; placed++;