// bola.c

typedef struct Bola {
    double x;
    double y;
    double vx;
    double vy;
    Cor* cor;
    int raio;
} Bola;

Bola* bola_new(double _x, double _y, double _vx, double _vy, Cor* _cor) {
    Bola* this = malloc(sizeof(Bola));
    this->x = _x;
    this->y = _y;
    this->vx = _vx;
    this->vy = _vx;
    this->cor = _cor;
    this->raio = 8;
    return this;
}

void bola_mover(Bola* this, double dt) {
  this->x += this->vx*dt;
  this->y += this->vy*dt;
}

void bola_desenhar(Bola* this, Tela* tela) {
  tela_circulo(tela, this->x, this->y, this->raio, this->cor); 
}

Hitbox* bola_getcaixa(Bola* this) {
    return hitbox_new(this->x - this->raio + 3, this->y - this->raio + 3,
        this->x + this->raio - 3, this->y + this->raio - 3);
}
