mirror of
https://github.com/Nimac0/SDL_Minigame
synced 2026-01-12 09:03:42 +00:00
48 lines
857 B
C++
48 lines
857 B
C++
#pragma once
|
|
#include <stdio.h>
|
|
#include <iostream>
|
|
#include <SDL.h>
|
|
#include <SDL_image.h>
|
|
#include <vector>
|
|
#include <string.h>
|
|
|
|
|
|
class AssetManager;
|
|
class ColliderComponent;
|
|
|
|
class Game
|
|
{
|
|
public:
|
|
Game();
|
|
~Game();
|
|
|
|
void init(const char* title, int xpos, int ypos, int width, int height, bool fullscreen);
|
|
|
|
void handleEvents();
|
|
void update();
|
|
void render();
|
|
void clean();
|
|
bool running();
|
|
|
|
static void addTile(int id, int x, int y);
|
|
static SDL_Renderer* renderer;
|
|
static SDL_Event event;
|
|
static std::vector<ColliderComponent*> colliders;
|
|
static AssetManager* assets;
|
|
|
|
enum GroupLabel
|
|
{
|
|
GROUP_MAP,
|
|
GROUP_PLAYERS,
|
|
GROUP_ENEMIES,
|
|
GROUP_COLLIDERS,
|
|
PROJECTILE
|
|
};
|
|
|
|
private:
|
|
int counter = 0;
|
|
bool isRunning = false;
|
|
SDL_Window* window;
|
|
};
|
|
|