summaryrefslogtreecommitdiff
path: root/rocks.h
diff options
context:
space:
mode:
authorSimponic <loganthebean222@gmail.com>2020-06-30 20:10:29 -0600
committerSimponic <loganthebean222@gmail.com>2020-06-30 20:10:29 -0600
commit3010473314505bd948c687ac644b7d87ef03298d (patch)
treee7099f6c431305cdd041d32ba244eb6360eec2f9 /rocks.h
parent7a60ab9f178dd813c876fcf8e25c947f9a9a5e06 (diff)
downloadasteroids-cs165-3010473314505bd948c687ac644b7d87ef03298d.tar.gz
asteroids-cs165-3010473314505bd948c687ac644b7d87ef03298d.zip
Updated file structure and changed indents to spaces
Diffstat (limited to 'rocks.h')
-rw-r--r--rocks.h84
1 files changed, 0 insertions, 84 deletions
diff --git a/rocks.h b/rocks.h
deleted file mode 100644
index ae12e2b..0000000
--- a/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 */