Deleted header file in source directory
parent
24fb96684c
commit
8ea9764165
@ -1,48 +0,0 @@
|
||||
#ifndef BALL_H
|
||||
#define BALL_H
|
||||
|
||||
class Ball {
|
||||
public:
|
||||
/* Variables */
|
||||
raylib::Vector2 pos;
|
||||
raylib::Vector2 initial_pos;
|
||||
raylib::Vector2 vel;
|
||||
raylib::Vector2 initial_vel;
|
||||
int radius;
|
||||
raylib::Color color;
|
||||
|
||||
/* Functions */
|
||||
Ball(int pos_x, int pos_y, int radius, int vel_x = 0, int vel_y = 0) {
|
||||
this->pos = raylib::Vector2(pos_x, pos_y);
|
||||
this->initial_pos = this->pos; // Create a copy of the position vector
|
||||
this->radius = radius;
|
||||
this->color = raylib::Color::White();
|
||||
this->vel = raylib::Vector2(vel_x, vel_y);
|
||||
this->initial_vel = this->vel; // Create a copy of the velocity vector
|
||||
return;
|
||||
}
|
||||
|
||||
void setPosition(Vector2 pos) {
|
||||
this->pos = pos;
|
||||
}
|
||||
|
||||
void reset() {
|
||||
this->pos = this->initial_pos;
|
||||
this->vel = this->initial_vel;
|
||||
return;
|
||||
}
|
||||
|
||||
void updatePosition() {
|
||||
this->pos.x += this->vel.x;
|
||||
this->pos.y += this->vel.y;
|
||||
return;
|
||||
}
|
||||
|
||||
void draw() {
|
||||
DrawCircle(this->pos.x, this->pos.y, this->radius, this->color); // This is a raylib function, not a raylib-cpp function
|
||||
return;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue