diff options
-rw-r--r-- | src/UIClass.cpp | 4 | ||||
-rw-r--r-- | src/main.cpp | 2 |
2 files changed, 4 insertions, 2 deletions
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){ |