staticsprite.java

来自「基于J2ME 开发的冒险类手机游戏」· Java 代码 · 共 48 行

JAVA
48
字号
package zonja;

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

public class StaticSprite extends ZonSprite {
	
	public StaticSprite(int scrWidth, int scrHeight) {
		super(scrWidth, scrHeight);
		setRealSize(16, 16);
	}
	
	public boolean saveData(DataOutputStream dos){
		if(!super.saveData(dos))
			return false;

		
		return true;
	}
	
	public boolean loadData(DataInputStream dis){
		if(!super.loadData(dis))
			return false;

		
		return true;
	}
	
	private int frameCount = 0;
	
	void mainAction() {
		frameCount++;
		
		if (offsetX < scrWidth && offsetX + frameWidth > 0){
			isVisible = true;
		} else {
			isVisible = false;
		}
		
		if(frameCount % 2 == 0){
			nextFrame();
			frameCount = 0;
		}
		
	}

}

⌨️ 快捷键说明

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