首页>代码>java awt实现飞机小游戏>/PlaneGame/src/cn/sxt/game/Explode.java
package cn.sxt.game;

import java.awt.Graphics;
import java.awt.Image;

/*
 * 爆炸类
 */
public class Explode {
	double x, y;
	
	//初始化一次。防止图片反复加载,占用资源
	static Image[] imgs = new Image[16];
	static {
		//通过循环逐一加载爆炸过程
		for (int i = 0; i < 16; i++) {
			imgs[i] = GameUtil.getImage("images/explode/e" + (i + 1) + ".gif");
			imgs[i].getWidth(null);
		}
	}
	
	
	int count;

	public void draw(Graphics g) {
		if (count <= 15) {
			//轮播图
			g.drawImage(imgs[count], (int) x, (int) y, null);
			count++;
		}
	}

	public Explode(double x, double y) {
		this.x = x;
		this.y = y;
	}
}
最近下载更多
喃喵xxxx  LV6 2022年4月20日
嘎哈SV这次非常  LV1 2021年12月23日
anAdmin  LV5 2021年10月27日
啊啊啊啊小  LV1 2021年7月1日
pipichao  LV6 2021年6月24日
陈岁月  LV1 2021年6月24日
zqk123  LV2 2021年6月22日
 LV10 2021年6月12日
1983929223  LV1 2021年3月8日
BANMAA  LV4 2020年12月24日
最近浏览更多
ClydeSon  LV5 2023年12月27日
微信网友_6790966844739584  LV2 2023年12月27日
2871581741  LV1 2023年12月22日
bangyiyang  LV2 2023年12月21日
412836806 2023年10月13日
暂无贡献等级
yangxb2  LV10 2023年7月11日
2017143155  LV12 2023年6月26日
啊伟大伟大 2023年6月18日
暂无贡献等级
微信网友_6508798513811456  LV5 2023年6月7日
总有人间一两风  LV8 2022年12月12日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友