aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/world.h1
-rw-r--r--src/main.cpp1
-rw-r--r--src/world.cpp7
3 files changed, 9 insertions, 0 deletions
diff --git a/include/world.h b/include/world.h
index 50f2483..cf0b7b8 100644
--- a/include/world.h
+++ b/include/world.h
@@ -66,6 +66,7 @@ public:
// it and is standing in front of it.
void addPlatform(float x,float y,float w,float h); // Dynamically adds a platform to the platform array. These will be automatically
// drawn and handled by the world.
+ void addHole(unsigned int start,unsigned int end); // Create a hole in the world
};
/*
diff --git a/src/main.cpp b/src/main.cpp
index d39bd92..c1b22af 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -100,6 +100,7 @@ int main(int argc, char *argv[]){
test->addLayer(400);
test->addLayer(100);
test->addPlatform(150,100,100,10);
+ test->addHole(100,150);
currentWorld=test;
IndoorWorld *iw=new IndoorWorld();
diff --git a/src/world.cpp b/src/world.cpp
index 2a0e471..5ba2e7d 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -239,6 +239,13 @@ World *World::goInsideStructure(Player *p){
return this;
}
+void World::addHole(unsigned int start,unsigned int end){
+ unsigned int i;
+ for(i=start;i<end;i++){
+ line[i].y=0;
+ }
+}
+
IndoorWorld::IndoorWorld(void){