get stuff working

This commit is contained in:
sfj 2025-10-29 13:37:50 +01:00
parent 127b96a92f
commit 57f271974a
5 changed files with 10 additions and 42 deletions

View File

@ -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();

View File

@ -8,6 +8,7 @@
#include "Player.hpp"
#include "Map.hpp"
#include "Zombo.hpp"
#include <stop_token>
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();

View File

@ -2,7 +2,7 @@
#define GAME_RENDERER_HPP
#include <string>
// #include <SDL2/SDL.h>
#include <SDL2/SDL.h>
#include "Sprite.hpp"
class GameRenderer
@ -34,4 +34,4 @@ public:
void redraw() const;
};
#endif
#endif

View File

@ -2,7 +2,7 @@
#define SPRITE_HPP
#include "Whatever.hpp"
// #include <SDL2/SDL_render.h>
#include <SDL2/SDL_render.h>
typedef struct {
SDL_Texture *texture;

View File

@ -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