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

📄 jumpdemo.java

📁 这是一个跳跳板的游戏的源代码,是一个不错的小游戏!
💻 JAVA
字号:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;


public class JumpDemo extends MIDlet {
	/** 储存了GameCanvas的变量 */
	private GameCanvas			gameCanvas;
	private boolean firstTime = true;
    private Display display = null;

	/** 构造函数 */
	public JumpDemo() {
		gameCanvas = new GameCanvas(this);
		display = Display.getDisplay(this);
	//	display.setCurrent(gameCanvas);
	}

	/** MIDlet开始时所调用的方法 */
	protected void startApp() throws MIDletStateChangeException {
		
		if (firstTime) {			
			splashScreen welcome = new splashScreen(display, gameCanvas);
			welcome.setDisplayTime(4000);
			display.setCurrent(welcome);
			firstTime = false;
		}
		gameCanvas.doStartApp();
	}

	/** MIDlet暂停时所调用的方法 */
	protected void pauseApp() {

		
		gameCanvas.doPauseApp();
	}

	/** MIDlet结束时所调用的方法 */
	protected void destroyApp(boolean unconditional)
		throws MIDletStateChangeException {}

	/** 结束MIDlet时所调用的方法 */
	void doExit() {
		try {
			destroyApp(false);
			notifyDestroyed();
		}catch(MIDletStateChangeException e) {}
	}
}

⌨️ 快捷键说明

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