aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-09-12 19:52:48 -0400
committerClyne Sullivan <tullivan99@gmail.com>2015-09-12 19:52:48 -0400
commitce7a96683ee94f8764e7811a5d6167b248accb7c (patch)
tree940f36c62610faa273a3b2ecf15968f0828930ad /include
parenta744d3312dd2f0253f7965253b3eff683cca3453 (diff)
entity-world binding
Diffstat (limited to 'include')
-rw-r--r--include/World.h5
-rw-r--r--include/entities.h7
2 files changed, 9 insertions, 3 deletions
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 <common.h>
+#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 <common.h>
-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();
};