76 lines
1.5 KiB
C++
76 lines
1.5 KiB
C++
#ifndef GUARD_GAME_H
|
|
#define GUARD_GAME_H
|
|
#include <vector>
|
|
#include "mingl/mingl.h"
|
|
#include "pixelManager.h"
|
|
#include "utils.h"
|
|
#include "playerDef.h"
|
|
#include "player.h"
|
|
#include "playMode.h"
|
|
#include "configData.h"
|
|
#include "projectiles.h"
|
|
#include "scoresManager.h"
|
|
#include "god.h"
|
|
#include "invadersGrid.h"
|
|
|
|
using namespace std;
|
|
|
|
class Game {
|
|
private:
|
|
MinGL window;
|
|
PixelManager pm;
|
|
ConfigData confData;
|
|
ScoresManager sm;
|
|
God god;
|
|
|
|
Position basePos;
|
|
InvadersGrid grid;
|
|
bool direction = true;
|
|
|
|
vector<missile> missiles;
|
|
vector<torpedo> torpedos;
|
|
|
|
PlayMode playMode;
|
|
vector<Player> players;
|
|
|
|
// invaders related variables
|
|
unsigned fireCooldown=120;
|
|
|
|
// basic methods
|
|
void updateColumns();
|
|
void handleScoreSaving();
|
|
Position invIndexToPos(unsigned x, unsigned y) const;
|
|
|
|
// drawing methods
|
|
void display(unsigned fps) const;
|
|
void displayGod() const;
|
|
void displayInvader(const Position& basePos, InvaderType type) const;
|
|
|
|
|
|
// managers
|
|
void managePlayers();
|
|
void manageOnePlayer(unsigned);
|
|
bool manageInvaders();
|
|
|
|
// collision things
|
|
void remCollidingProjectiles();
|
|
void moveMissiles();
|
|
void moveTorpedos();
|
|
bool checkMissilesAndPlayers();
|
|
bool checkTorpedosAndInvaders();
|
|
bool invadersTouchPlayer() const;
|
|
|
|
// god things
|
|
void awakeGod();
|
|
void manageGod();
|
|
|
|
public:
|
|
// in case someone wants to mess with the code, here's a minimal API, costs nothing to us
|
|
Game();
|
|
void managedGames();
|
|
WinValue playGame();
|
|
|
|
bool reloadConfig();
|
|
};
|
|
|
|
#endif |