Diamond Rush Game For Nokia X2-01 320x240 -
private void restartGame() newGame();
public void handleInput() int key = getGameAction(getKeyStates()); diamond rush game for nokia x2-01 320x240
class GameCanvas extends Canvas private int menuSelection = 0; private void restartGame() newGame()
public void run() { while (running) { if (gameState == STATE_PLAYING) canvas.handleInput(); canvas.repaint(); try Thread.sleep(50); catch (Exception e) {} } } g.drawString("Press OK to Start"
private void drawMenu(Graphics g) g.setColor(0, 0, 0); g.fillRect(0, 0, getWidth(), getHeight()); g.setColor(255, 215, 0); g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_LARGE)); g.drawString("DIAMOND RUSH", getWidth()/2, 40, Graphics.HCENTER); g.setColor(255, 255, 255); g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_PLAIN, Font.SIZE_MEDIUM)); g.drawString("Press OK to Start", getWidth()/2, 120, Graphics.HCENTER); g.drawString("Use 2,4,6,8 to move", getWidth()/2, 160, Graphics.HCENTER); g.drawString("5 to pick diamonds", getWidth()/2, 190, Graphics.HCENTER);