/* * 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 #include #include #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(std::string 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 colliders; static bool debugMenu; static bool isRunning; static bool debugCollisionBoxes; static bool gravityOnPlayer; static bool playerIsGrounded; static bool playerIsJumping; static Vector2D playerPosition; static Vector2D pVel; static SDL_Rect camera; static AssetManager* assets; static GameStateManager* gsm; std::string BoolToString(bool b); enum groupLabels : std::size_t { groupMap, groupPlayers, groupEnemies, groupColliders, groupProjectiles, groupObjects, groupBackground, groupUI_Layer0, groupUI_Layer1, groupUI_Layer2, groupUI_Layer3 }; private: int counter = 0; // bool isRunning = false; SDL_Window *window; // SDL_Renderer *renderer; }; #endif /* GAME_HPP_ */