From f4e392912a3812b602f787c6db30296cea14962e Mon Sep 17 00:00:00 2001 From: Simponic Date: Fri, 6 Nov 2020 11:48:27 -0700 Subject: Added files --- src/point.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/point.cpp (limited to 'src/point.cpp') diff --git a/src/point.cpp b/src/point.cpp new file mode 100644 index 0000000..4b89a4a --- /dev/null +++ b/src/point.cpp @@ -0,0 +1,33 @@ +#include "point.h" +#include "velocity.h" + +Point :: Point() { + setX(0.0f); + setY(0.0f); +} + +Point :: Point (const float x, const float y) { + setX(x); + setY(y); +} + +void Point :: setX(const float x) { + this->x = x; +} + +void Point :: setY(const float y) { + this->y = y; +} + +float Point :: getX() { + return this->x; +} + +float Point :: getY() { + return this->y; +} + +void Point :: update(Velocity &vel) { + this->x += vel.getDx(); + this->y += vel.getDy(); +} -- cgit v1.2.3-70-g09d2