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

📄 elimilator.java

📁 j2me开发 简单示例 包括 游戏主菜单、rms功能模块
💻 JAVA
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -