ferdbold_unbreakout/Paddle.pde
// PADDLE

public class Paddle {

  Rectangle rectangle;
  // PADDLE PROPERTIES --
  int width = 60;
  int height = 5;
  boolean hasStroke = false;
  color strokeColor = #FFFFFF;
  boolean hasFill = true;
  color fillColor;

  int x = gameFrameWidth/2;
  int y = 270;

  Paddle() {
    fillColor = color(random(255), random(255), random(255));
    rectangle = new Rectangle(width, height, hasStroke, strokeColor, hasFill, fillColor);
    rectangle.setPosition(x, y);
  }

  void refresh() {
    updatePosition();
    rectangle.setPosition(x, y);
    rectangle.drawYourself();
  }

  void updatePosition() {
    x = mouseX-recX-width/2;
    x = constrain(x, 0, gameFrameWidth-width);
  }
}
