43 lines
951 B
C++
43 lines
951 B
C++
#ifndef DATA_HPP
|
|
#define DATA_HPP
|
|
|
|
#include "globals.hpp"
|
|
|
|
#include <SFML/Graphics/Color.hpp>
|
|
#include <SFML/System/Vector2.hpp>
|
|
#include <array>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
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 };
|
|
};
|
|
|
|
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:
|
|
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
|