- 1
- 0
- 约2.97万字
- 约 23页
- 2017-05-12 发布于河南
- 举报
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
您可能关注的文档
最近下载
- 2026年牛津译林版中考英语新课标1500个单词背诵清单.pdf
- 疥疮诊疗中国专家共识(2026版)解读PPT课件.pptx VIP
- 《烟雾病和烟雾综合征诊断与治疗中国专家共识(2024)》解读PPT课件.pptx VIP
- 2024年改良型新药行业研究报告及未来五至十年预测分析报告.docx
- 乡镇民主生活会批评与自我批评.docx VIP
- 陕西凤翔县马家庄秦墓出土的出土陶罐.docx VIP
- 采血后预防淤青的按压方式.pptx VIP
- 纺织厂供配电系统设计.doc VIP
- 乡镇领导班子成员相互批评意见.docx VIP
- 30.XX中专职业学校“十五五”五年中长期发展规划(2026-2030年).pdf
原创力文档

文档评论(0)