data drivin all code sucess
This commit is contained in:
+19
-7
@@ -1,6 +1,16 @@
|
||||
#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
|
||||
|
||||
#include "globals.hpp"
|
||||
|
||||
#include <SFML/Graphics/Color.hpp>
|
||||
@@ -22,21 +32,23 @@ struct EntityData : ObjectData {
|
||||
};
|
||||
|
||||
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";
|
||||
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 // DATA_HPP
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user