SuperSpaceInvaderTurboApoca.../headers/game.h
2022-01-02 00:13:35 +01:00

61 lines
1.1 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"
using namespace std;
class Game {
private:
MinGL window;
PixelManager pm;
ConfigData confData;
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 display();
// managers
void managePlayers();
void manageOnePlayer(unsigned);
bool manageInvaders();
// collision things
void remCollidingProjectiles();
void moveMissiles();
void moveTorpedos();
bool checkMissilesAndPlayers();
bool checkTorpedosAndInvaders();
bool invadersTouchPlayer();
public:
// in case someone wants to mess with the code, here's a minimal API, costs nothing to us
Game();
void managedGames();
WinValue playGame();
PlayMode initialMenuHandler();
bool deathMenuHandler();
bool reloadConfig();
};
#endif