diff --git a/src/Game.cpp b/src/Game.cpp index 2fa0a24..c7dd00f 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -48,7 +48,10 @@ void Game::draw() map.draw(player.x, player.y); for (const auto& arrow : arrows) { - arrow. draw(player.x, player.y); + arrow.draw(player.x, player.y); + } + for (const auto& zombo : zombos) { + zombo.draw(player.x, player.y); } player.draw(); diff --git a/src/Game.hpp b/src/Game.hpp index 5c77863..42aad27 100644 --- a/src/Game.hpp +++ b/src/Game.hpp @@ -8,6 +8,7 @@ #include "Player.hpp" #include "Map.hpp" #include "Zombo.hpp" +#include class Game { @@ -26,6 +27,8 @@ private: public: Game() : renderer("Zombo Shooter", 800, 450), player(&renderer), map(&renderer, 40) {} + ~Game() = default; + void run(); void draw(); diff --git a/src/GameRenderer.hpp b/src/GameRenderer.hpp index e85c859..3cc9849 100644 --- a/src/GameRenderer.hpp +++ b/src/GameRenderer.hpp @@ -2,7 +2,7 @@ #define GAME_RENDERER_HPP #include -// #include +#include #include "Sprite.hpp" class GameRenderer @@ -34,4 +34,4 @@ public: void redraw() const; }; -#endif \ No newline at end of file +#endif diff --git a/src/Sprite.hpp b/src/Sprite.hpp index cdd2ec6..2b1c45d 100644 --- a/src/Sprite.hpp +++ b/src/Sprite.hpp @@ -2,7 +2,7 @@ #define SPRITE_HPP #include "Whatever.hpp" -// #include +#include typedef struct { SDL_Texture *texture; diff --git a/src/Whatever.hpp b/src/Whatever.hpp index 3092cfe..607ed2a 100644 --- a/src/Whatever.hpp +++ b/src/Whatever.hpp @@ -1,42 +1,4 @@ #ifndef WHATEVER_HPP #define WHATEVER_HPP -using SDL_Texture = void; -using SDL_Renderer = void; -using SDL_Window = void; - -enum SDL_Event_type { - SDL_QUIT, - SDL_KEYDOWN, - SDL_KEYUP, - SDL_MOUSEBUTTONDOWN, -}; - -enum SDL_Event_keysym_sym { - SDLK_RIGHT, - SDLK_d, - SDLK_LEFT, - SDLK_a, - SDLK_DOWN, - SDLK_s, - SDLK_UP, - SDLK_w, -}; - -struct SDL_Event { - SDL_Event_type type; - struct { - struct { - SDL_Event_keysym_sym sym; - } keysym; - } key; - struct { - int button; - } button; -}; - - -void SDL_WaitEvent(SDL_Event*); -void SDL_GetMouseState(int*, int*); - #endif