diff options
author | drumsetmonkey <abelleisle@roadrunner.com> | 2015-10-28 11:55:21 -0400 |
---|---|---|
committer | drumsetmonkey <abelleisle@roadrunner.com> | 2015-10-28 11:55:21 -0400 |
commit | 193af27884fc910b4ffa7212ec772894c03e36ee (patch) | |
tree | ce3a10772b3af81815261a11959da6e715eaa96f /src/world.cpp | |
parent | a3e3f43a51e4a8137dff779f38b358b5b8608e4e (diff) |
Locked camera to world bounds and added basic mountain backdrop
Diffstat (limited to 'src/world.cpp')
-rw-r--r-- | src/world.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/world.cpp b/src/world.cpp index 168ac4c..9fe76b0 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -42,6 +42,7 @@ World::World(void){ } void World::generate(unsigned int width){ // Generates the world and sets all variables contained in the World class. + worldWidth = width; unsigned int i; float inc; @@ -199,7 +200,7 @@ LOOP2: * the 'for' loop below that draws the layer. */ - v_offset=(p->loc.x + p->width / 2 - current->x_start) / HLINE; + v_offset=(offset.x + p->width / 2 - current->x_start) / HLINE; // is -> i start @@ -208,7 +209,7 @@ LOOP2: // ie -> i end - ie=v_offset + (SCREEN_WIDTH / 2 / HLINE) + GEN_INC; + ie=v_offset + (SCREEN_WIDTH / 2 / HLINE) + GEN_INC + HLINE; if(ie>current->lineCount)ie=current->lineCount; // Maximum bound /* |