ColorLinezMIDlet.java
上传用户:jinxueyang
上传日期:2016-05-15
资源大小:104k
文件大小:1k
- package game;
- import javax.microedition.midlet.*;
- import javax.microedition.lcdui.*;
- /**
- * MIDlet类
- */
- public class ColorLinezMIDlet extends MIDlet
- {
- static ColorLinezMIDlet instance;
- public static int gameGrade = 2;
- public static int menuIndex = 0;
- public static boolean isPlaySound = true;
- Display display;
- public ColorLinezMIDlet()
- {
- instance = this;
- display = Display.getDisplay(this);
- }
- public void startApp()
- {
- //获得当前显示的界面
- Displayable d = display.getCurrent();
- if ( d != null && d instanceof LinezCanvas )
- {
- ((LinezCanvas)d).start();
- }
- else
- {
- display.setCurrent(new LogoCanvas(display, 1));
- }
- }
- public void pauseApp()
- {
- //获得当前显示的界面
- Displayable d = display.getCurrent();
- //如果界面是游戏界面
- if(d != null && d instanceof LinezCanvas)
- {
- //关闭线程
- ((LinezCanvas)d).stop();
- }
- }
- public void destroyApp(boolean unconditional)
- {
- }
- public static void quitApp()
- {
- instance.destroyApp(true);
- instance.notifyDestroyed();
- instance = null;
- }
- }