diff options
Diffstat (limited to 'src/World.cpp')
-rw-r--r-- | src/World.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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!"<<std::endl;
@@ -87,6 +88,9 @@ LOOP2: goto LOOP2;
}else{
drawOffsetX=drawOffsetY=0;
+ for(i=0;i<entCount;i++){
+ ((Entity **)entity)[i]->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;
+}
|