class HitBox {
  float x, y, offsetX, offsetY, width, height;
  
  HitBox(float offsetX, float offsetY, float w, float h){
    this.offsetX = offsetX;
    this.offsetY = offsetY;
    width = w;
    height = h;    
  }
  
  void update(float x, float y){
    this.x = x + offsetX;
    this.y = y + offsetY;
  }
  
  void render() {
    stroke(0,255,0);
    noFill();
    rectMode(CORNER);
    rect (x , y , width, height);
    noStroke();
  }
  boolean overlap(HitBox b){
    return (x + width > b.x && b.x + b.width > x && y + height > b.y && b.y + b.height > y);
  }
}