aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-09-10 15:19:18 -0400
committerClyne Sullivan <tullivan99@gmail.com>2015-09-10 15:19:18 -0400
commit1a3f4ac5ac12700757d2558ee06f202ad43aa841 (patch)
treec4df6844f422b7506b611311933d6568f4fd538b /include
parenta3db993224c994fdff6f50fedcc266c5e0b94aa8 (diff)
added linked worlds
Diffstat (limited to 'include')
-rw-r--r--include/World.h7
-rw-r--r--include/common.h2
2 files changed, 6 insertions, 3 deletions
diff --git a/include/World.h b/include/World.h
index e405059..3b4b56d 100644
--- a/include/World.h
+++ b/include/World.h
@@ -3,7 +3,8 @@
#include <common.h>
-#define HLINE (2.0f/(SCREEN_WIDTH/4))
+#define goWorldLeft(w) if(w->toLeft){w=w->toLeft;}
+#define goWorldRight(w) if(w->toRight){w=w->toRight;}
class World {
private:
@@ -13,7 +14,9 @@ private:
} *line;
unsigned int lineCount;
public:
- World(float width);
+ World *toLeft,*toRight;
+ World(void);
+ World(const float width,World *l,World *r);
void draw(void);
void detect(vec2 *v,const float width);
};
diff --git a/include/common.h b/include/common.h
index 782ebd6..9ce1be0 100644
--- a/include/common.h
+++ b/include/common.h
@@ -18,7 +18,7 @@ typedef struct{float x; float y;}vec2;
#define SCREEN_HEIGHT 800
#define FULLSCREEN
-
+#define HLINE (2.0f/(SCREEN_WIDTH/4))
//SDL VARIABLES
extern SDL_Window *window;