diff options
author | Logan Hunt <loganthebean222@gmail.com> | 2020-08-12 14:13:50 -0600 |
---|---|---|
committer | Logan Hunt <loganthebean222@gmail.com> | 2020-08-12 14:13:50 -0600 |
commit | 70ea8877ace50d2ce609d7d5f721c887b0ea83ec (patch) | |
tree | 514aa4f3d10b0a1db21928f8a002aa10458ecbb5 /src/UFO.cpp | |
parent | 495f771530ce1869098bc568f34c243697cab73c (diff) | |
download | skeet-cs165-70ea8877ace50d2ce609d7d5f721c887b0ea83ec.tar.gz skeet-cs165-70ea8877ace50d2ce609d7d5f721c887b0ea83ec.zip |
Added files
Diffstat (limited to 'src/UFO.cpp')
-rw-r--r-- | src/UFO.cpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/UFO.cpp b/src/UFO.cpp new file mode 100644 index 0000000..3739d21 --- /dev/null +++ b/src/UFO.cpp @@ -0,0 +1,65 @@ +#include "UFO.h" +#include "point.h" +#include "velocity.h" +#include <iostream> +using namespace std; +// UFO Default constructor +UFO :: UFO() +{ + setAlive ( true ); +} + +// Get Ufo point +Point UFO :: getPoint() const +{ + return this->point; +} + +// Get UFO velocity +Velocity UFO:: getVelocity() const +{ + return this->velocity; +} + +// Get UFO alive +bool UFO :: isAlive() const +{ + return this->alive; +} + +// Set UFO point +void UFO :: setPoint( const Point &point ) +{ + this->point = point; +} + +// Set UFO velocity +void UFO :: setVelocity( const Velocity &velocity) +{ + this->velocity = velocity; +} + +// Set UFO velocity with dy & dx +void UFO :: setVelocity ( float dx , float dy ) +{ + velocity = Velocity ( dx , dy ); +} + +// Set UFO alive +void UFO :: setAlive ( const bool alive ) +{ + this->alive = alive; +} + +// Advance UFO +void UFO :: advance() +{ + setPoint ( this->velocity.updatePoint ( this->point ) ); +} + + +// Kill UFO +void UFO :: kill() +{ + this->alive = false; +} |