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 --- src/World.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/World.cpp') diff --git a/src/World.cpp b/src/World.cpp index 82735bd..8f9308e 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -3,7 +3,7 @@ World::World(void){ line=NULL; - lineCount=0; + lineCount=entCount=0; toLeft=toRight=behind=infront=NULL; } World::World(const float width,World *l,World *r){ @@ -17,6 +17,7 @@ World::World(const float width,World *l,World *r){ toLeft=l; toRight=r; behind=infront=NULL; + entCount=0; if(toLeft){ if(toLeft->toRight){ std::cout<<"There's already a world to the left!"<draw(); + } } } void World::detect(vec2 *v,const float width){ @@ -141,3 +145,6 @@ void World::addLayer(const float width){ behind->infront=this; } } +void World::addEntity(void *e){ + entity[entCount++]=e; +} -- cgit v1.2.3