SuperSpaceInvaderTurboApoca.../headers/game.h
2021-12-26 16:37:02 +01:00

47 lines
906 B
C++

#ifndef GUARD_GAME_H
#define GUARD_GAME_H
#include <vector>
#include "mingl/mingl.h"
#include "pixelManager.h"
#include "config.h"
#include "utils.h"
#include "position.h"
using namespace std;
class Game {
private:
PixelManager pm;
Config conf;
position basePos;
aliensGrid grid;
bool direction = true;
vector<missile> missiles;
vector<torpedo> torpedos;
unsigned playerX;
void managePlayer();
bool manageInvaders();
void display();
// collision thingies
unsigned manageAllCollisions();
void remCollidingProjectiles();
void moveMissiles();
void moveTorpedos();
bool checkMissilesAndPlayer();
bool checkTorpedosAndInvaders();
bool invadersTouchFloor();
public:
// in case someone wants to mess with the code, here's a minimal API, costs nothing to us
Game();
void managedGames();
unsigned playGame();
void initialMenuHandler();
void deathMenuHandler();
};
#endif