diff options
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 |