This commit is contained in:
Gentoo
2026-01-14 20:57:15 -05:00
parent ad2d01ab05
commit 7bbf50b581
7 changed files with 204 additions and 254 deletions
+25 -9
View File
@@ -5,22 +5,38 @@
#include <SFML/Graphics/Color.hpp>
#include <SFML/System/Vector2.hpp>
#include <array>
#include <string>
#include <vector>
class ObjectData {
public:
sf::Vector2<float> size = { TILESIZE, TILESIZE };
sf::Vector2<float> pos = { TILESIZE, TILESIZE };
sf::Color interior_color = sf::Color::Black;
sf::Color exterior_color = sf::Color::White;
float edge = -2.0f;
struct ObjectData {
sf::Vector2<float> size { TILESIZE, TILESIZE };
sf::Vector2<float> pos { TILESIZE, TILESIZE };
sf::Color interior_color { sf::Color::Black };
sf::Color exterior_color { sf::Color::White };
float edge { -2.0f };
};
class EntityData : public ObjectData {
struct EntityData : ObjectData {
sf::Vector2<float> velocity { 0, 0 };
};
struct PlayerData : EntityData {
ObjectData object;
EntityData entity;
float dash_length { 0.0f };
float max_vertical_acceleration { 0.0f };
};
class LevelData {
public:
sf::Vector2<float> velocity;
std::array<std::array<char, MAX_COLS>, MAX_ROWS> data = {};
std::string name = "Null";
};
extern std::vector<ObjectData> object_data;
extern std::vector<EntityData> entity_data;
extern std::vector<LevelData> level_data;
extern PlayerData player_data;
#endif // DATA_HPP