61 lines
1.1 KiB
C++
61 lines
1.1 KiB
C++
#ifndef DATA_HPP
|
|
#define DATA_HPP
|
|
|
|
// Timers
|
|
#define DASH 1
|
|
#define LEVEL_SWITCH 2
|
|
|
|
// Maps
|
|
#define EMPTY 0
|
|
#define DEFAULT 1
|
|
#define PLATFORM1 2
|
|
#define CHECKERED 3
|
|
#define BASE 4
|
|
|
|
#include <SFML/Graphics/Color.hpp>
|
|
#include <SFML/System/Vector2.hpp>
|
|
#include <array>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "globals.hpp"
|
|
|
|
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
|
|
{
|
|
float max_dash_acceleration { 0.0f };
|
|
float max_vertical_acceleration { 0.0f };
|
|
};
|
|
|
|
struct LevelData
|
|
{
|
|
std::array<std::array<char, MAX_COLS>, MAX_ROWS> data {};
|
|
};
|
|
|
|
struct TimerData
|
|
{
|
|
std::string name { "NULL" };
|
|
float max_time { 1.f };
|
|
};
|
|
|
|
extern std::vector<ObjectData> object_data;
|
|
extern std::vector<EntityData> entity_data;
|
|
extern std::vector<LevelData> level_data;
|
|
extern std::vector<TimerData> timer_data;
|
|
extern PlayerData player_data;
|
|
|
|
#endif
|