From d8b164e4727c887979d4da6a4011a444749862fc Mon Sep 17 00:00:00 2001 From: Simponic Date: Thu, 13 Aug 2020 12:07:52 -0600 Subject: Better file structure, stuff is better in general --- include/game.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 include/game.h (limited to 'include/game.h') 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 +#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 rocks; + vector bullets; + Ship* ship; + int level = 0; + + float getClosestDistance( const FlyingObject &obj1 , const FlyingObject &obj2 ) const; + + vector 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 */ -- cgit v1.2.3-70-g09d2