import java.awt.*;
import java.applet.*; 

class GunSprite extends BitmapSprite implements Moveable, Intersect {
    
    public GunSprite(Image i, Applet a) {

	super(i,a);

    }
    
    // the following methods implement Moveable:
    
    public void setPosition(int x,int y) {

	locx = x;
	locy = y;

    }
    
    public void setVelocity(int x,int y) {
	
    }
    
    public void updatePosition() {
	
    }
    
    // the following methods implement Intersect:    
    
    public boolean intersect(int x1,int y1,int x2,int y2) { // compare bounding boxes
	
	return visible           && 
	    (x2 >= locx)         && 
	    (locx+width >= x1)   && 
	    (y2 >= locy)         && 
	    (locy+height >= y1);
	
    }
    
    public void hit() { 
	System.out.println("HIT!");
    }
    
}