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

📄 mainmidlet.java

📁 应用j2me技术开发的手机游戏
💻 JAVA
字号:
import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

public class MainMidlet extends MIDlet {

	Display dis;
	long time1, time2;
	Sound s, sfight;
	Game game;

	public MainMidlet() {
		s = new Sound("/bg1.mid");
		sfight = new Sound("/zhandou.mid");
		dis = Display.getDisplay(this);
		time1 = System.currentTimeMillis();

	}

	protected void destroyApp(boolean arg0) throws MIDletStateChangeException {

	}

	protected void pauseApp() {

	}

	protected void startApp() throws MIDletStateChangeException {

		showLogo1();

	}

	void showLogo1() {

		dis.setCurrent(new Logo(this));

	}

	void showManu() {

		dis.setCurrent(new Manu(this));

	}

	public void showHelp() {

		dis.setCurrent(new Help(this));
	}

	void showGame() {
		game = new Game(this);
		dis.setCurrent(game);
		game.start();

	}

	void loadGame(int id) {
		dis.setCurrent(new Game(this));
		new SaveAndLoad(this).load(id, new Game(this));
	}

	void exit() {
		try {
			destroyApp(true);
			this.notifyDestroyed();
		} catch (MIDletStateChangeException e) {

			e.printStackTrace();
		}

	}
}

⌨️ 快捷键说明

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