diff options
author | rtk0c <[email protected]> | 2022-06-03 23:26:44 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2022-06-03 23:26:44 -0700 |
commit | 60ccc62f4934e44ad5b905fdbcf458302b8d8a09 (patch) | |
tree | 02ec83cc8387abfd08bd5ee7ea4e8115f1bfb8d0 /source/30-game/Player.hpp | |
parent | c2ef7737536bf1f8c81fcfae95c0183b21c9753f (diff) |
Changeset: 63 [WIP] Rename directories
Diffstat (limited to 'source/30-game/Player.hpp')
-rw-r--r-- | source/30-game/Player.hpp | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/source/30-game/Player.hpp b/source/30-game/Player.hpp deleted file mode 100644 index d003a25..0000000 --- a/source/30-game/Player.hpp +++ /dev/null @@ -1,55 +0,0 @@ -#pragma once - -#include "GameObject.hpp" -#include "Material.hpp" -#include "RcPtr.hpp" -#include "Sprite.hpp" - -#define GLFW_INCLUDE_NONE -#include <GLFW/glfw3.h> - -#include <span> -#include <vector> - -struct PlayerKeyBinds { - int keyLeft = GLFW_KEY_A; - int keyRight = GLFW_KEY_D; - int keyJump = GLFW_KEY_SPACE; - int keyAttack = GLFW_KEY_J; - - bool pressedLeft = 0; - bool pressedRight = 0; - bool pressedJump = 0; - bool pressedAttack = 0; - - std::span<int> GetKeyArray(); - std::span<bool> GetKeyStatusArray(); -}; - -class Player : public GameObject { -public: - std::vector<GLFWkeyboard*> boundKeyboards; - PlayerKeyBinds keybinds; - Sprite sprite; - RenderObject renderObject; - int mId; - -public: - Player(GameWorld* world, int id); - - virtual void Awaken() override; - virtual void Resleep() override; - virtual void Update() override; - - Material* GetMaterial() const; - void SetMaterial(Material* material); - virtual std::span<const RenderObject> GetRenderObjects() const override; - - int GetId() const { return mId; } - - void HandleKeyInput(int key, int action); - - // File is designated by player ID - bool LoadFromFile(); - bool SaveToFile(); -}; |