elimilator.java
来自「j2me开发 简单示例 包括 游戏主菜单、rms功能模块」· Java 代码 · 共 121 行
JAVA
121 行
package com.gowin.firstgame;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
public class Elimilator extends MIDlet {
protected Display display;
private Image splashLogo;
private boolean isSplash = true;
private MainMenuScreen mainMenuScren;
private SettingScreen settingScreen;
private HightScoreScreen hightScoreScren;
private HelpScreen helpScren;
private AboutScreen aboutScreen;
private static Score score;
private static final String scoreRMSString = "Elimilator_Score";
private static Setting setting;
private static final String settingRMSString = "Elimilator_Setting";
public Elimilator() {
// do nothing
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
System.gc();
notifyDestroyed();
}
protected void pauseApp() {
}
protected void startApp() throws MIDletStateChangeException {
if( isSplash ){
isSplash = false;
try{
setting = new Setting(settingRMSString);
setting.loadSetting();
score = new Score(scoreRMSString);
score.loadScores();
display = Display.getDisplay(this);
mainMenuScren = new MainMenuScreen(this);
settingScreen = new SettingScreen(this, setting);
hightScoreScren = new HightScoreScreen(this , score);
helpScren = new HelpScreen(this);
aboutScreen = new AboutScreen(this);
splashLogo = Image.createImage("/gilr.png");
new SplashScreen( display , mainMenuScren , splashLogo , 3000);
}catch(Exception ex){
ex.printStackTrace();
mainMenuScreenShow();
}
}else{
mainMenuScreenShow();
}
}
public Display getDisplay(){
return display;
}
public Image createImage( String imgFileName ){
Image img = null;
try{
img = Image.createImage(imgFileName);
}
catch(Exception e){
}
return img;
}
public void mainMenuScreenShow() {
display.setCurrent(mainMenuScren);
}
public void mainMenuScreenQuit(){
try {
destroyApp(true);
} catch (MIDletStateChangeException e) {
e.printStackTrace();
}
}
public void settingScreenShow(){
try {
settingScreen.init();
} catch (Exception e) {
e.printStackTrace();
}
display.setCurrent(settingScreen);
}
public void hightScoreScreenShow(){
try {
hightScoreScren.init();
} catch (Exception e) {
e.printStackTrace();
}
display.setCurrent(hightScoreScren);
}
public void helpScreenShow(){
display.setCurrent(helpScren);
}
public void aboutScreenShow(){
display.setCurrent(aboutScreen);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?