aboutsummaryrefslogtreecommitdiffstats
path: root/src/world.cpp
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2015-10-28 11:55:21 -0400
committerdrumsetmonkey <abelleisle@roadrunner.com>2015-10-28 11:55:21 -0400
commit193af27884fc910b4ffa7212ec772894c03e36ee (patch)
treece3a10772b3af81815261a11959da6e715eaa96f /src/world.cpp
parenta3e3f43a51e4a8137dff779f38b358b5b8608e4e (diff)
Locked camera to world bounds and added basic mountain backdrop
Diffstat (limited to 'src/world.cpp')
-rw-r--r--src/world.cpp5
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
/*