summaryrefslogtreecommitdiff
path: root/src/game.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.h')
-rw-r--r--src/game.h103
1 files changed, 103 insertions, 0 deletions
diff --git a/src/game.h b/src/game.h
new file mode 100644
index 0000000..4c26bc4
--- /dev/null
+++ b/src/game.h
@@ -0,0 +1,103 @@
+/*************************************************************
+ * File: game.h
+ * Author: Br. Burton
+ *
+ * Description: The game of Skeet. This class holds each piece
+ * of the game (birds, bullets, rifle, score). It also has
+ * methods that make the game happen (advance, interact, etc.)
+ *
+ * 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 GAME_H
+#define GAME_H
+
+#include <vector>
+
+#include "uiDraw.h"
+#include "uiInteract.h"
+#include "point.h"
+#include "velocity.h"
+#include "rifle.h"
+
+
+// TODO: include your bullet and bird classes
+#include "bullet.h"
+#include "bird.h"
+#include "sacredBird.h"
+#include "toughBird.h"
+#include "standardBird.h"
+#include "UFO.h"
+
+#define CLOSE_ENOUGH 15
+
+
+/*****************************************
+ * GAME
+ * The main game class containing all the state
+ *****************************************/
+class Game
+{
+public:
+ /*********************************************
+ * Constructor
+ * Initializes the game
+ *********************************************/
+ Game(Point tl, Point br);
+ ~Game();
+
+ /*********************************************
+ * Function: handleInput
+ * Description: Takes actions according to whatever
+ * keys the user has pressed.
+ *********************************************/
+ void handleInput(const Interface & ui);
+
+ /*********************************************
+ * Function: advance
+ * Description: Move everything forward one
+ * step in time.
+ *********************************************/
+ void advance();
+
+ /*********************************************
+ * Function: draw
+ * Description: draws everything for the game.
+ *********************************************/
+ void draw(const Interface & ui);
+
+private:
+ // The coordinates of the screen
+ Point topLeft;
+ Point bottomRight;
+
+ int score;
+
+ Rifle rifle;
+ std::vector<Bullet> bullets;
+
+ // TODO: declare your bird here (e.g., "Bird * bird;")
+ Bird * bird[3];
+
+ /*************************************************
+ * Private methods to help with the game logic.
+ *************************************************/
+ bool isOnScreen(const Point & point);
+ void advanceBullets();
+ void advanceBird();
+ Bird* createBird();
+
+ void handleCollisions();
+ void cleanUpZombies();
+
+ /*************************************************
+ * Private value to check if user want to play
+ *************************************************/
+ bool bStartGame;
+
+ void startGame();
+};
+
+#endif /* GAME_H */