From ce7a96683ee94f8764e7811a5d6167b248accb7c Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sat, 12 Sep 2015 19:52:48 -0400 Subject: entity-world binding --- include/World.h | 5 +++++ include/entities.h | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/World.h b/include/World.h index 09e06d9..216be98 100644 --- a/include/World.h +++ b/include/World.h @@ -3,6 +3,8 @@ #include +#define MAX_ENTITIES 8 + #define goWorldLeft(w) if(w->toLeft){w=w->toLeft;} #define goWorldRight(w) if(w->toRight){w=w->toRight;} @@ -13,6 +15,8 @@ private: double start; // Where to change to dirt, going down (y) } __attribute__ ((packed)) *line; unsigned int lineCount; + unsigned int entCount; + void *entity[MAX_ENTITIES]; public: World *behind,*infront; World *toLeft,*toRight; @@ -24,6 +28,7 @@ public: void saveToFile(FILE *f,World *parent); void loadFromFile(FILE *f,World *parent); void addLayer(const float width); + void addEntity(void *e); }; #endif // WORLD_H diff --git a/include/entities.h b/include/entities.h index e50c77a..7cd657a 100644 --- a/include/entities.h +++ b/include/entities.h @@ -3,7 +3,7 @@ #include -class Entities{ +class Entity{ public: float width; float height; @@ -14,15 +14,16 @@ public: bool right,left; void spawn(float, float); + void draw(void); }; -class Player : public Entities{ +class Player : public Entity{ public: Player(); ~Player(); }; -class NPC : public Entities{ +class NPC : public Entity{ public: NPC(); }; -- cgit v1.2.3