From 9542d9a8a022fe1d3390510e8a135a4917df7aa7 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Thu, 29 Oct 2015 08:13:09 -0400 Subject: fixed world --- src/ui.cpp | 6 +++++- src/world.cpp | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ui.cpp b/src/ui.cpp index 8f19e34..e6d18d2 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -237,7 +237,11 @@ namespace ui { player->ground=false; } } - if(SDL_KEY==SDLK_i)currentWorld=currentWorld->goWorldBack(player); // Go back a layer if possible + if(SDL_KEY==SDLK_i){ + player->vel.y=.5; + player->ground=false; + currentWorld=currentWorld->goWorldBack(player); // Go back a layer if possible + } if(SDL_KEY==SDLK_k)currentWorld=currentWorld->goWorldFront(player); // Go forward a layer if possible if(SDL_KEY==SDLK_LSHIFT)player->speed = 3; // Sprint if(SDL_KEY==SDLK_LCTRL)player->speed = .5; diff --git a/src/world.cpp b/src/world.cpp index 9fe76b0..ec91c02 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -42,7 +42,6 @@ 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; @@ -582,6 +581,10 @@ void World::addHole(unsigned int start,unsigned int end){ } } +int World::getWidth(void){ + return -x_start; +} + IndoorWorld::IndoorWorld(void){ } -- cgit v1.2.3