]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
holes
authorClyne Sullivan <tullivan99@gmail.com>
Thu, 1 Oct 2015 01:02:26 +0000 (21:02 -0400)
committerClyne Sullivan <tullivan99@gmail.com>
Thu, 1 Oct 2015 01:02:26 +0000 (21:02 -0400)
include/world.h
src/main.cpp
src/world.cpp

index 50f2483643ad397eafc3e4772bdcee992b31de8b..cf0b7b8fc1010056e862f3e8ff6016e40eddf2b5 100644 (file)
@@ -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
 };
 
 /*
index d39bd92d99a0c3a8f7e57a56ed2a53628aac7202..c1b22afe67b236b6b684e8dc91b72cb2e1af2e1a 100644 (file)
@@ -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();
index 2a0e471cebc10e4da776d531aaa21e0ace2f6929..5ba2e7d37c1516aa7ee93a62e485d11984987ccd 100644 (file)
@@ -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){