⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sprite.java

📁 J2ME程序开发实用例子
💻 JAVA
字号:
/**
 * 精灵类
 * <p>Title: 精灵类 </p>
 * <p>Description:</p>
 * <p>Copyright: (c) 2007</p>
 * @author QN
 * @version 1.0
 */
public class Sprite {
	public void copyPos(Sprite spt){
		this.x = spt.x;
		this.y = spt.y;
//		this.z = spt.z;
	}
	public Sprite(){
		
	}
	
	//07-05-02
	int[] resList;
	int[] frames;
	int framesCount;
	int curFrame;
	boolean isFrameOver;
	public void nextFrame(){
		if(frames != null){
			curFrame = frames[framesCount++];
			if(framesCount > frames.length - 1){
				framesCount = 0;
				isFrameOver = true;
			}
		}
	}
	
	public int x,y;//,z

	public int w, h,hZ = 5;//精灵宽高
	
	public int vx,vy,ay,vz;//加速度,重力,
	
	public int id,listID = -1;//精灵的ID
	
	public boolean isHide;//不进行绘制	

	public short state,oldState;
	
	private int dir = DIR_RIGHT;
	public void setDir(int dir){this.dir = dir;}
	public int getDir(){return dir;}

	public void setState(short i) {
		state = i;
	}

	//-dir
	public static final byte DIR_LEFT = 2;
	
	public static final byte DIR_RIGHT = 3;

	public static final byte DIR_UP = 0;

	public static final byte DIR_DOWN = 1;	


}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -