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

📄 fsprite.java

📁 经典FC游戏《超惑星战记》的J2ME版本!!功能基本上都实现了
💻 JAVA
字号:
/**
 * <p>Title: Transpanzer</p>
 * <p>Description:
 * You cannot remove this copyright and notice.
 * You cannot use this file any part without the express permission of the author.
 * All Rights Reserved</p>
 * @author Jjyo
 * @email jjyo@163.com
 * @version 1.0.0
 */

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

public class FSprite {

	public int x; // 横坐标
	public int y; // 纵坐标
	public static Rect rect1=new Rect();
	public static Rect rect2=new Rect();
	public int pow;//生命
	
	public  int frameCnt; // Sprite的帧计数器
	public  boolean isHidden; // Sprite是否隐藏
	public  int timeCnt; // Sprite的时间计数器
	
	public void action(){ // Sprite的动作
	}

	public void reInit(int x, int y){ // 初始化函数
		this.x = x;
		this.y = y;
		isHidden = false;
	}
	
	/**
	 * !!!注意 存 和 读的数据要一一对应,顺序不能错,不然的话,只能存,不能读
	 * @param dis
	 * @throws IOException
	 */
	//读档
	public void readData(DataInputStream dis) throws IOException{
		x=dis.readInt();
		y=dis.readInt();
		frameCnt=dis.readInt();
		isHidden=dis.readBoolean();
		timeCnt=dis.readInt();
	}
	
	//存档
	public void writeData(DataOutputStream dos) throws IOException{
		dos.writeInt(x);
		dos.writeInt(y);
		dos.writeInt(frameCnt);
		dos.writeBoolean(isHidden);
		dos.writeInt(timeCnt);
	}
}

⌨️ 快捷键说明

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