📄 roadrun.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -