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/rifle.h | |
parent | 495f771530ce1869098bc568f34c243697cab73c (diff) | |
download | skeet-cs165-70ea8877ace50d2ce609d7d5f721c887b0ea83ec.tar.gz skeet-cs165-70ea8877ace50d2ce609d7d5f721c887b0ea83ec.zip |
Added files
Diffstat (limited to 'src/rifle.h')
-rw-r--r-- | src/rifle.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/rifle.h b/src/rifle.h new file mode 100644 index 0000000..f095680 --- /dev/null +++ b/src/rifle.h @@ -0,0 +1,60 @@ +/************************************************************* + * File: rifle.h + * Author: Br. Burton + * + * Description: Defines a Rifle. + * + * Please DO NOT share this code with other students from + * other sections or other semesters. They may not receive + * the same code that you are receiving. + *************************************************************/ + +#ifndef RIFLE_H +#define RIFLE_H + +#include "point.h" + +#define RIFLE_WIDTH 5 +#define RIFLE_HEIGHT 40 + +#define ANGLE_MAX 90 +#define ANGLE_MIN 0 +#define ANGLE_START 45 + +#define RIFLE_MOVE_AMOUNT 3 + +class Rifle +{ +private: + Point point; + + /********************************************************** + * angle - The angle of the rifles in degrees. + * Assumes that straight right is 0 degrees and up is 90. + **********************************************************/ + float angle; + + +public: + Rifle(const Point & point) : point(point) { angle = ANGLE_START; } + + /**************** + * Basic Getters + ****************/ + float getAngle() const { return angle; } + Point getPoint() const { return point; } + + /***************** + * Drawing + *****************/ + void draw() const; + + /***************** + * Movement + *****************/ + void moveLeft(); + void moveRight(); + +}; + +#endif |