SuperSpaceInvaderTurboApoca.../headers/game.h
2021-12-31 18:28:33 +01:00

57 lines
1.0 KiB
C++

#ifndef GUARD_GAME_H
#define GUARD_GAME_H
#include <vector>
#include "mingl/mingl.h"
#include "pixel_manager.h"
#include "utils.h"
#include "position.h"
#include "player_def.h"
#include "player.h"
#include "play_mode.h"
#include "configData.h"
using namespace std;
class Game {
private:
MinGL window;
PixelManager pm;
ConfigData confData;
position basePos;
aliensGrid grid;
bool direction = true;
vector<missile> missiles;
vector<torpedo> torpedos;
PlayMode playMode;
Player p1;
Player p2;
void managePlayers();
bool manageInvaders();
void display();
// collision thingies
void remCollidingProjectiles();
void moveMissiles();
void moveTorpedos();
bool checkMissilesAndPlayers();
bool checkTorpedosAndInvaders();
bool invadersTouchPlayer();
void managePlayerMoves(PlayerDef&, unsigned&);
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