get stuff working
This commit is contained in:
parent
127b96a92f
commit
57f271974a
@ -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();
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
#define GAME_RENDERER_HPP
|
||||
|
||||
#include <string>
|
||||
// #include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL.h>
|
||||
#include "Sprite.hpp"
|
||||
|
||||
class GameRenderer
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user