From 0e50f3c18c68e4c42546a52147e10cac1202b96f Mon Sep 17 00:00:00 2001 From: drumsetmonkey Date: Thu, 29 Oct 2015 09:17:43 -0400 Subject: Made background painting dynamic, and made new tree backdrops --- src/gameplay.cpp | 7 +------ src/ui.cpp | 2 ++ src/world.cpp | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/gameplay.cpp b/src/gameplay.cpp index 9e0cc99..964794f 100644 --- a/src/gameplay.cpp +++ b/src/gameplay.cpp @@ -35,12 +35,7 @@ void initEverything(void){ */ World *test=new World(); - test->generate(SCREEN_WIDTH); - - /* - * Add two layers, a platform, and a hole to the world. - */ - + test->generate(SCREEN_WIDTH * 2); test->addLayer(400); test->addPlatform(150,100,100,10); diff --git a/src/ui.cpp b/src/ui.cpp index e6d18d2..e0ebc50 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -19,6 +19,7 @@ static char *dialogBoxText; namespace ui { vec2 mouse; bool debug=false; + bool posFlag=false; bool dialogBoxExists=false; unsigned int fontSize; @@ -247,6 +248,7 @@ namespace ui { if(SDL_KEY==SDLK_LCTRL)player->speed = .5; } if(SDL_KEY==SDLK_F3)debug^=true; + if(SDL_KEY==SDLK_b & SDL_KEY==SDLK_F3)posFlag^=true; break; /* KEYUP diff --git a/src/world.cpp b/src/world.cpp index 97ec5ac..c04c88a 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -581,8 +581,8 @@ void World::addHole(unsigned int start,unsigned int end){ } } -int World::getStart(void){ - return -x_start; +int World::getTheWidth(void){ + return x_start*-2; } IndoorWorld::IndoorWorld(void){ -- cgit v1.2.3