package pnf;

import javax.swing.ImageIcon;

public class Bullet {
	int x,y,h,w;
	int speed;
	ImageIcon image;
	ImageIcon[] images = new ImageIcon[]{new ImageIcon("lib/zd_1.gif"),new ImageIcon("lib/zd_2.gif")};
	
	/**
	 * 
	 * @param k 子弹类型
	 * @throws IOException
	 */
	public Bullet(int k, int x, int y) {
		// TODO Auto-generated constructor stub
		this.x = x;
		this.y = y;
		if(k == 0){
			image = images[0];
		}else{
			image = images[1];
		}
		w = image.getIconWidth();
		h = image.getIconHeight();
		speed = 5;
	}
	/**子弹走一步*/
	public void step() {
		x += speed;
	}
}
