Control.java
上传用户:public
上传日期:2010-01-27
资源大小:484k
文件大小:2k
- package GameDisplay;
- import javax.microedition.lcdui.*;
- import java.util.*;
- public class Control {
- public static MainMIDlet main;
- public static Display d;
- public static ShowGame game;
- public static MyAlert myAlert;
- public static ChoiceLevel choice;
- public static HelpMe help;
- public static About about;
- public static Menu menu;
- public static HighRecord highrecord;
- public static PlayerNameRecord nameRecord;
- public static void Init(MainMIDlet m) { //起始传参数
- main = m;
- game = new ShowGame();
- myAlert = new MyAlert();
- choice = new ChoiceLevel();
- help=new HelpMe();
- about=new About();
- menu=new Menu();
- highrecord=new HighRecord();
- nameRecord=new PlayerNameRecord();
- d = Display.getDisplay(main);
- }
- public static void showGame() {
- game.Initgame() ;
- d.setCurrent(game);
- }
- public static void showAlert() {
- d.setCurrent(myAlert);
- }
- public static void showMenu() {
- d.setCurrent(menu);
- }
- public static void showChoiceLevel() {
- d.setCurrent(choice);
- }
- public static void showHighRecord() {
- d.setCurrent(highrecord);
- }
- public static void showNameRecord() {
- d.setCurrent(nameRecord);
- }
- public static void showHelp() {
- d.setCurrent(help);
- }
- public static void showAbout() {
- d.setCurrent(about);
- }
- public static void pause() {
- game.setVx(0);
- game.setVy(0);
- game.setVyback(0);
- game.setIsPause(true);
- }
- public static void goOn() {
- game.setVx(5);
- game.setVy(10);
- game.setVyback(choice.choice.getSelectedIndex()+2);
- game.setIsPause(false);
- }
- public static void quitApp() {
- main.destroyApp(true);
- main.notifyDestroyed();
- main = null;
- }
- }