gamemidlet.java

来自「一个J2ME编译的打地鼠小游戏,供初学者学习」· Java 代码 · 共 39 行

JAVA
39
字号
import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;


public class GameMidlet extends MIDlet {
	private GameScreen gs = null;
	
	protected void destroyApp(boolean arg0){

	}

	protected void pauseApp() {
        GameScreen.phoneIn();
	}

	protected void startApp() throws MIDletStateChangeException {
		ActivateGameScreen(this);
	}
    
	/**
	 * 启动游戏
	 * @param gameMidlet
	 */
	private void ActivateGameScreen(GameMidlet gameMidlet) {
		if(gs==null)
		    gs = new GameScreen(gameMidlet);
		Display.getDisplay(this).setCurrent(gs);
	}
	
	/**
	 * 退出程序
	 */
	void Quit(){
	    notifyDestroyed();
	    destroyApp(true);
	}
}

⌨️ 快捷键说明

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