From d68b30ee201579e06f050a9448e4dcf883860064 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sat, 12 Sep 2015 16:05:15 -0400 Subject: fexid --- src/UIClass.cpp | 4 +++- src/main.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/UIClass.cpp b/src/UIClass.cpp index 319db5c..318ba00 100644 --- a/src/UIClass.cpp +++ b/src/UIClass.cpp @@ -17,6 +17,8 @@ void UIClass::handleEvents(){ if(e.key.keysym.sym == SDLK_d) player.right = true; if(e.key.keysym.sym == SDLK_a) player.left = true; if(e.key.keysym.sym == SDLK_SPACE) player.loc.y += 10; + if(e.key.keysym.sym == SDLK_i)if(currentWorld->behind) currentWorld=currentWorld->behind; + if(e.key.keysym.sym == SDLK_k)if(currentWorld->infront)currentWorld=currentWorld->infront; break; case SDL_KEYUP: if(e.key.keysym.sym == SDLK_d) player.right = false; @@ -25,4 +27,4 @@ void UIClass::handleEvents(){ break; } } -} \ No newline at end of file +} diff --git a/src/main.cpp b/src/main.cpp index 674acea..3e8d04f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -132,7 +132,7 @@ int main(int argc,char **argv){ prevTime = SDL_GetTicks(); } - player.loc.x += player.vel.x * (deltaTime / 2); //update the player's x based on + player.loc.x += player.vel.x*deltaTime; //update the player's x based on gw=currentWorld->getWidth(); if(player.loc.x+player.width>-1+gw){ -- cgit v1.2.3