⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 eliminator.java

📁 J2ME & Gaming中文版教程,里来还包含该书的源码,是手机游戏的书.相信大家看了之后,会对手机游戏编程有一个很深的了解
💻 JAVA
字号:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class Eliminator extends MIDlet {
  protected Display display;
  private Image splashLogo;
  private boolean isSplash = true;

  private MainMenuScreen mainMenuScreen;
  private SettingsScreen settingsScreen;
  private HighScoreScreen highScoreScreen;
  private HelpScreen helpScreen;
  private AboutScreen aboutScreen;

  public Eliminator() {
  }

  public void startApp() {
    display = Display.getDisplay(this);
    mainMenuScreen = new MainMenuScreen(this);
    settingsScreen = new SettingsScreen(this);
    highScoreScreen = new HighScoreScreen(this);
    helpScreen = new HelpScreen(this);
    aboutScreen = new AboutScreen(this);
    if(isSplash) {
      isSplash = false;
      try {
        splashLogo = Image.createImage("/splash.png");
        new SplashScreen(display, mainMenuScreen, splashLogo,3000);
      } catch(Exception ex) {
        mainMenuScreenShow();
      }
    } else {
      mainMenuScreenShow();
    }

  }

  public Display getDisplay() {
    return display;
  }

  public void pauseApp() {
  }

  public void destroyApp(boolean unconditional) {
    System.gc();
    notifyDestroyed();
  }

  private Image createImage(String filename) {
    Image image = null;
    try {
      image = Image.createImage(filename);
    } catch (Exception e) {
    }
    return image;
  }

  public void mainMenuScreenShow() {
    display.setCurrent(mainMenuScreen);
  }

  public void settingsScreenShow() {
    display.setCurrent(settingsScreen);
  }

  public void highScoreScreenShow() {
    display.setCurrent(highScoreScreen);
  }

  public void helpScreenShow() {
    display.setCurrent(helpScreen);
  }

  public void aboutScreenShow() {
    display.setCurrent(aboutScreen);
  }

  public void mainMenuScreenQuit() {
    destroyApp(true);
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -