BeagleRescue/src/game/Game.hpp

65 lines
1.5 KiB
C++

/*
* Game.hpp
*
* Created on: Feb 9, 2020
* Author: ayoungblood
*/
#ifndef GAME_HPP_
#define GAME_HPP_
#include "SDL2/SDL.h"
#include "SDL2/SDL_image.h"
#include "SDL2/SDL_mixer.h"
#include <stdio.h>
#include <iostream>
#include <vector>
#include "Vector2D.h"
#include "../assetmgr/AssetManager.h"
#include "GameStateManager.h"
class ColliderComponent;
class AssetManager;
class Game {
public:
Game();
virtual ~Game();
void init(const char* title, int width, int height, bool fullscreen, int globalScale);
void handleEvents();
void update();
void render();
void clean();
void printDebug(char* debugInfo);
static void drawLine(Vector2D srcpt, Vector2D destpt, int red, int green, int blue);
bool running() { return isRunning; }
// static void AddTile(int srcX, int srcY, int xpos, int ypos);
static SDL_Renderer *renderer;
static SDL_Event event;
// static std::vector<ColliderComponent*> colliders;
static bool isRunning;
static bool debugCollisionBoxes;
static bool gravityOnPlayer;
static bool playerIsGrounded;
static SDL_Rect camera;
static AssetManager* assets;
static GameStateManager* gsm;
enum groupLabels : std::size_t
{
groupMap,
groupPlayers,
groupEnemies,
groupColliders,
groupProjectiles,
groupObjects,
groupBackground,
groupUI_Layer0,
groupUI_Layer1
};
private:
int counter = 0;
// bool isRunning = false;
SDL_Window *window;
// SDL_Renderer *renderer;
};
#endif /* GAME_HPP_ */