macros and ui element
This commit is contained in:
@@ -6,15 +6,8 @@
|
||||
#include <object/sound.hpp>
|
||||
|
||||
namespace Game::AGame {
|
||||
class Background : public Object::Entity {
|
||||
using Object::Entity::Entity;
|
||||
|
||||
public:
|
||||
~Background() override = default;
|
||||
void start() override;
|
||||
void update(float deltaTime) override;
|
||||
|
||||
GAME_ENTITY(Background)
|
||||
private:
|
||||
Object::Sound mSound;
|
||||
};
|
||||
END_GAME_ENTITY()
|
||||
}
|
||||
@@ -6,13 +6,8 @@
|
||||
#include <object/sound.hpp>
|
||||
|
||||
namespace Game::AGame {
|
||||
class CamController : public Object::Entity {
|
||||
using Object::Entity::Entity;
|
||||
|
||||
GAME_ENTITY(CamController)
|
||||
public:
|
||||
~CamController() override = default;
|
||||
void start() override;
|
||||
void update(float deltaTime) override;
|
||||
void onWindowResized(int newWidth, int newHeight) override {
|
||||
mScreenW = newWidth;
|
||||
mScreenH = newHeight;
|
||||
@@ -20,5 +15,5 @@ namespace Game::AGame {
|
||||
|
||||
private:
|
||||
int mScreenW, mScreenH;
|
||||
};
|
||||
END_GAME_ENTITY()
|
||||
}
|
||||
@@ -6,16 +6,9 @@
|
||||
#include <object/sound.hpp>
|
||||
|
||||
namespace Game::AGame {
|
||||
class Player : public Object::Entity {
|
||||
using Object::Entity::Entity;
|
||||
|
||||
public:
|
||||
~Player() override = default;
|
||||
void start() override;
|
||||
void update(float deltaTime) override;
|
||||
|
||||
GAME_ENTITY(Player)
|
||||
private:
|
||||
Object::Sound mSound;
|
||||
float mSpeed = 200.f; // Pixels per second
|
||||
};
|
||||
END_GAME_ENTITY()
|
||||
}
|
||||
@@ -11,9 +11,18 @@ namespace Game {
|
||||
static bool isKeyPressed(SDL_Scancode key);
|
||||
static bool isKeyJustPressed(SDL_Scancode key);
|
||||
static bool isKeyJustReleased(SDL_Scancode key);
|
||||
static bool isMouseButtonPressed(Uint8 button);
|
||||
static bool isMouseButtonJustPressed(Uint8 button);
|
||||
static bool isMouseButtonJustReleased(Uint8 button);
|
||||
static float getMouseX();
|
||||
static float getMouseY();
|
||||
private:
|
||||
static const bool* mCurrentKeyStates;
|
||||
static bool* mPreviousKeyStates;
|
||||
static const bool* mPreviousKeyStates;
|
||||
static int mNumKeys;
|
||||
static SDL_MouseButtonFlags mCurrentMouseButtonStates;
|
||||
static SDL_MouseButtonFlags mPreviousMouseButtonStates;
|
||||
static float mMouseX;
|
||||
static float mMouseY;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user