public void commandAction(Command c, Displayable d) if (c == exitCommand) destroyApp(true); notifyDestroyed();
switch (map[y][x]) Graphics.LEFT); break; case TILE_PLAYER: g.setColor(0, 200, 0); g.fillRect(px, py, TILE_SIZE-1, TILE_SIZE-1); g.setColor(255, 255, 255); g.drawString("@", px+5, py+2, Graphics.TOP diamond rush game for nokia x2-01 320x240
public DiamondRush() display = Display.getDisplay(this); canvas = new GameCanvas(); exitCommand = new Command("Exit", Command.EXIT, 1); canvas.addCommand(exitCommand); canvas.setCommandListener(this); public void commandAction(Command c, Displayable d) if (c
private void newGame() generateRandomLevel(); diamondsCollected = 0; exitOpen = false; gameState = STATE_PLAYING; public void commandAction(Command c
private void drawHUD(Graphics g) Graphics.LEFT); if (exitOpen) g.setColor(0, 255, 0); g.drawString("EXIT OPEN!", getWidth()-70, 5, Graphics.TOP