diff options
author | Simponic <loganthebean222@gmail.com> | 2020-08-13 12:07:52 -0600 |
---|---|---|
committer | Simponic <loganthebean222@gmail.com> | 2020-08-13 12:07:52 -0600 |
commit | d8b164e4727c887979d4da6a4011a444749862fc (patch) | |
tree | 63ae5ebfab9c1e438c0c2ccc97668e3ab809bdbd /src/rocks.h | |
parent | 40a568c50224c2832aeb13bd469d714d126118e1 (diff) | |
download | asteroids-cs165-d8b164e4727c887979d4da6a4011a444749862fc.tar.gz asteroids-cs165-d8b164e4727c887979d4da6a4011a444749862fc.zip |
Better file structure, stuff is better in general
Diffstat (limited to 'src/rocks.h')
-rw-r--r-- | src/rocks.h | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/src/rocks.h b/src/rocks.h deleted file mode 100644 index ae12e2b..0000000 --- a/src/rocks.h +++ /dev/null @@ -1,84 +0,0 @@ -#ifndef rocks_h -#define rocks_h - -#define BIG_ROCK_SIZE 16 -#define MEDIUM_ROCK_SIZE 8 -#define SMALL_ROCK_SIZE 4 - -#define BIG_ROCK_SPIN 2 -#define MEDIUM_ROCK_SPIN 5 -#define SMALL_ROCK_SPIN 10 - -#include "flyingObject.h" -#include <vector> - -using namespace std; - -class Rock : public FlyingObject -{ -protected: - int rotationDegPerFrame; - int size; - float angle; -public: - Rock() : FlyingObject() , rotationDegPerFrame ( 0 ) , size ( 1 ) , angle ( 0 ) {} - Rock ( int degPerFrame , int size , float angle ) : rotationDegPerFrame ( degPerFrame ) , size ( size ) , angle ( angle ) {} - - int getRotationDegPerFrame() { return rotationDegPerFrame; } - int getSize () { return size; } - float getAngle() { return angle; } - - void setAngle ( const float angle ) { this->angle = angle; } - void setRotationDegPerFrame ( const int degPerFrame ) { this->rotationDegPerFrame = degPerFrame; } - void setSize ( const int size ) { this->size = size; } - void advance() { this->angle += rotationDegPerFrame; FlyingObject::advance(); } - virtual void draw() {}; - virtual vector<Rock *> destroy() = 0; -}; - -class BigRock : public Rock -{ -public: - BigRock ( const Point &point , const Velocity &velocity ) - { - setPoint ( point ); - setAngle ( 0 ); - setSize ( BIG_ROCK_SIZE ); - setRotationDegPerFrame ( BIG_ROCK_SPIN ); - setAngle ( random ( 0 , 360 ) ); - setVelocity ( velocity ); - } - - vector<Rock *> destroy(); - void draw(); -}; - -class MediumRock : public Rock -{ -public: - MediumRock ( const Point &point , const Velocity &vel ) { - this->point = point; - this->velocity = vel; - setAngle ( 0 ); - setRotationDegPerFrame ( MEDIUM_ROCK_SPIN ); - setSize ( MEDIUM_ROCK_SIZE ); - } - vector<Rock *> destroy(); - void draw(); -}; - -class SmallRock : public Rock -{ -public: - SmallRock( const Point &point , const Velocity &vel ) { - this->point = point; - this->velocity = vel; - setAngle ( 0 ); - setRotationDegPerFrame ( SMALL_ROCK_SPIN ); - setSize ( SMALL_ROCK_SIZE ); - } - vector<Rock *> destroy(); - void draw(); -}; - -#endif /* rocks_h */ |