public class Tools {
static final int UP_TYPE = -1;// 向上按键
static final int DOWN_TYPE = -2;// 向下按键
static final int LIFT_TYPE = -3;// 向左按键
static final int RIGHT_TYPE = -4;// 向右按键
static final int ATTACK_TYPE = -5;// 攻击键
static final int L_TYPE = -6;//左按键
static final int R_TYPE = -7;//右按键
static final byte PLAY=0,LOADING=3,LOGO=1;//
public static final byte LEFT = 7, RIGHT = 8;
// 读图片
public static Image read_image(String filename) {
Image img = null;
try {
img = Image.createImage("/" + filename + ".png");
} catch (Exception e) {
// TODO 自动生成 catch 块
// System.out.println("图象加载错误 " + filename);
}
return img;
}
}
ScreenBase类
public abstract class ScreenBase {
public ScreenBase() {
// TODO Auto-generated constructor stub
}
/**
* 逻辑更新
*/
public abstract void update();
/**
* 按键
* @param iAction
*/
public abstract void input(int iAction);
/**
* 画图
* @param grap 画笔
*/
public abstract void render();
/**
* 释放
*/
public abstract void free();
// TODO Auto-generated method stub
<< 上一页 [11] [12] [13] [14] [15] [16] [17] [18] [19] 下一页