class Misil {
    float x;
    float y;
    float w;
    float h;
    boolean toDelete;
    
    Misil(float xx, float yy) {
        this.x = xx;
        this.y = yy;
        this.toDelete = false;
    }
    
    void show() {
        noStroke();
        fill(255);
        this.w = 5;
        this.h = 12;
        rect( this.x, this.y, this.w, this.h );
    }
  
    void evaporate() {
        this.toDelete = true;
    }
  
    boolean hits( AnimatedSprite obj) {
        float d = dist(this.x, this.y, obj.x, obj.y);
        if (d < (obj.getWidth()/6)) {
          return true;
        } else {
          return false;
        }
    }
  
    boolean getit(float xx, float yy) {
        float d = dist(this.x, this.y, xx, yy);
        if (d < 18) {
            return true;
        } else {
            return false;
        }
    }
  
    void move() {
        this.y = this.y + 2;
    } 
}
