summaryrefslogtreecommitdiff
path: root/include/game.h
diff options
context:
space:
mode:
authorSimponic <loganthebean222@gmail.com>2020-08-13 12:07:52 -0600
committerSimponic <loganthebean222@gmail.com>2020-08-13 12:07:52 -0600
commitd8b164e4727c887979d4da6a4011a444749862fc (patch)
tree63ae5ebfab9c1e438c0c2ccc97668e3ab809bdbd /include/game.h
parent40a568c50224c2832aeb13bd469d714d126118e1 (diff)
downloadasteroids-cs165-d8b164e4727c887979d4da6a4011a444749862fc.tar.gz
asteroids-cs165-d8b164e4727c887979d4da6a4011a444749862fc.zip
Better file structure, stuff is better in general
Diffstat (limited to 'include/game.h')
-rw-r--r--include/game.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/include/game.h b/include/game.h
new file mode 100644
index 0000000..943ed63
--- /dev/null
+++ b/include/game.h
@@ -0,0 +1,54 @@
+/*********************************************************************
+ * File: game.h
+ * Description: Defines the game class for Asteroids
+ *
+ *********************************************************************/
+
+#ifndef GAME_H
+#define GAME_H
+
+#include <vector>
+#include "bullet.h"
+#include "ship.h"
+#include "rocks.h"
+#include "uiDraw.h"
+#include "uiInteract.h"
+
+#define CLOSE_ENOUGH 15
+
+using namespace std;
+
+class Game
+{
+private:
+ Point topLeft;
+ Point bottomRight;
+ vector<Rock *> rocks;
+ vector<Bullet *> bullets;
+ Ship* ship;
+ int level = 0;
+
+ float getClosestDistance( const FlyingObject &obj1 , const FlyingObject &obj2 ) const;
+
+ vector<Rock *> createRocks();
+
+ void advanceBullets();
+ void advanceAsteroids();
+ void advanceShip();
+
+ void cleanUpZombies();
+
+ void handleCollisions();
+
+ void drawBullets();
+ void drawRocks();
+ void drawShip();
+public:
+ Game ( const Point &tl , const Point &br );
+ void handleInput ( const Interface &ui );
+ void draw ( const Interface &ui );
+ void advance();
+};
+
+
+#endif /* GAME_H */