diff --git a/includes/paddle.hpp b/includes/paddle.hpp index 962f68a..858acc7 100644 --- a/includes/paddle.hpp +++ b/includes/paddle.hpp @@ -25,6 +25,9 @@ public: /* Increments the number of points that this paddle has earned */ void incrementPoints(); + /* Sets the paddle position */ + void setPosition(int x, int y); + /* Resets the paddle position */ void reset(); diff --git a/paddle.cpp b/paddle.cpp index fcf3304..5e5f0d7 100644 --- a/paddle.cpp +++ b/paddle.cpp @@ -22,6 +22,12 @@ void Paddle::incrementPoints() { return; } +void Paddle::setPosition(int x, int y) { + this->rectangle.x = x; + this->rectangle.y = y; + return; +} + void Paddle::reset() { this->rectangle.x = this->initial_pos.x; this->rectangle.y = this->initial_pos.y;