diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/entities.h | 33 | ||||
-rw-r--r-- | include/world.h | 36 |
2 files changed, 42 insertions, 27 deletions
diff --git a/include/entities.h b/include/entities.h index 450975f..442219c 100644 --- a/include/entities.h +++ b/include/entities.h @@ -139,10 +139,10 @@ public: vec2 loc; vec2 vel; - + float width; float height; - + float speed; // A speed factor for X movement /* @@ -172,7 +172,7 @@ public: char *name; GENDER gender; - + Texturec *tex; Texturec *ntex; @@ -180,22 +180,21 @@ public: void draw(void); void spawn(float, float); - + int ticksToUse; // Used by wander() - + virtual void wander(int){} virtual void interact(){} void follow(Entity *e); - + virtual ~Entity(){} }; class Player : public Entity{ public: QuestHandler qh; - bool light = false; - + Player(); ~Player(); void save(void); @@ -206,10 +205,10 @@ class NPC : public Entity{ public: std::vector<int (*)(NPC *)>aiFunc; int dialogIndex; - + NPC(); ~NPC(); - + void addAIFunc(int (*func)(NPC *),bool preload); void clearAIFunc(void); virtual void interact(); @@ -233,10 +232,10 @@ public: World *inWorld; std::string inside; std::string textureLoc; - + Structures(); ~Structures(); - + unsigned int spawn(BUILD_SUB, float, float); }; @@ -246,10 +245,10 @@ public: double init_y; void (*hey)(Mob *callee); std::string heyid; - + Mob(int); ~Mob(); - + void wander(int); }; @@ -259,13 +258,13 @@ private: public: std::string pickupDialog; bool questObject = false; - + Object(); Object(std::string in,std::string pd); ~Object(); - + void reloadTexture(void); - + void interact(void); }; #endif // ENTITIES_H diff --git a/include/world.h b/include/world.h index 152d654..85b5370 100644 --- a/include/world.h +++ b/include/world.h @@ -47,16 +47,6 @@ enum class WorldWeather : unsigned char { }; /** - * The light structure, used to store light coordinates and color. - */ - -typedef struct { - vec2 loc; /**< Light location */ - Color color; /**< Light color */ - float radius; -} Light; - -/** * The line structure. * This structure is used to store the world's ground, stored in vertical * lines. Dirt color and grass properties are also kept track of here. @@ -86,6 +76,32 @@ extern std::string currentXML; class World; /** + * The light structure, used to store light coordinates and color. + */ + +typedef struct { + vec2 loc; /**< Light location */ + Color color; /**< Light color */ + float radius; /**< Light radius */ + + bool belongsTo; + Entity *following; + + bool flame; + float fireFlicker; + vec2 fireLoc; + + // Light(vec2 l, Color c, float r){ + // loc = l; + // color = c; + // radius = r; + // belongsTo = false; + // following = nullptr; + // } +} Light; + + +/** * The village class, used to group structures into villages. */ |