roadrun.java

来自「青蛙過河~ 就是青蛙過馬路 過馬路很危險請小心... that s a」· Java 代码 · 共 52 行

JAVA
52
字号
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class RoadRun extends MIDlet{
   
   	private MainMenu menu;
   	
   	private GameScreen gameScreen;


   	public RoadRun(){
     	//MIDlet constructor instantiates the main menu.
      	menu = new MainMenu(this);
   	}
   	
   	public void activateGameScreen() {
   		
      gameScreen = new GameScreen(this); 
      Display.getDisplay(this).setCurrent(gameScreen);
   }
   
   //Called by the game classes to indicate to the user that the current game is over.
   	public void gameOver(){
  		
  		// Display an alert (the device will take care of implementing how to
      	// show it to the user.
      	Alert alert = new Alert("", "Splat! Game Over", null, AlertType.INFO);
      	// Then set the menu to be current.
      	Display.getDisplay(this).setCurrent(alert, menu);
   	}
   
   
   	public void close(){
   	
      	try{
        	destroyApp(true);
         	notifyDestroyed();
      	}catch (MIDletStateChangeException e){ }
   	}

   	public void startApp() throws MIDletStateChangeException{
      	Display.getDisplay(this).setCurrent(menu);
   	}

   	public void pauseApp(){
   	}

   	public void destroyApp(boolean unconditional) throws MIDletStateChangeException{
   	}

}

⌨️ 快捷键说明

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