J2ME手机游戏设计案例源代码-GameEngine_TiledLayer2.docVIP

  • 1
  • 0
  • 约2.97万字
  • 约 23页
  • 2017-05-12 发布于河南
  • 举报

J2ME手机游戏设计案例源代码-GameEngine_TiledLayer2.doc

J2ME手机游戏设计案例源代码-GameEngine_TiledLayer2

**********GameMID.java /* * To change this template, choose Tools | Templates * and open the template in the editor. */ import javax.microedition.lcdui.Display; import javax.microedition.midlet.*; /** * @author Administrator */ public class GameMID extends MIDlet { private Display display; private GameWorld gw=null; public GameMID(){ display = Display.getDisplay(this); //获取Display gw=new GameWorld(this); //创建游戏画布 display.setCurrent(gw); //设置游戏画布为当前显示画面 } public void startApp() { if(gw!=null){ gw.start(); //游戏开始执行 } } public void pauseApp() { if(gw!=null){ gw.setPaused(true); //游戏暂停执行 } } public void destroyApp(boolean unconditional) { } /* 退出程序 */ public void exit(){ try{ destroyApp(false); }catch(Exception e){} notifyDestroyed(); } } **********GameDesign.java /* * To change this template, choose Tools | Templates * and open the template in the editor. */ import javax.microedition.midlet.*; import javax.microedition.lcdui.*; import javax.microedition.lcdui.game.*; import java.io.IOException; /** * @author Administrator */ public class GameDesign { //editor-fold defaultstate=collapsed desc= Generated Fields //GEN-BEGIN:|fields|0| private Image TiledBG2; private Image TiledBG; public int Fireseq001Delay = 200; public int[] Fireseq001 = {34, 35, 36, 35}; private TiledLayer BackGround; public int FireBackGround; private TiledLayer Build; ///editor-fold//GEN-END:|fields|0| //editor-fold defaultstate=collapsed desc= Generated Methods //GEN-BEGIN:|methods|0| ///editor-fold//GEN-END:|methods|0| public Image getTiledBG() throws java.io.IOException {//GEN-BEGIN:|1-getter|0|1-preInit if (TiledBG == null) {//GEN-END:|1-getter|0|1-preInit // write pre-init user code here Tiled

文档评论(0)

1亿VIP精品文档

相关文档