]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
fexid
authorClyne Sullivan <tullivan99@gmail.com>
Sat, 12 Sep 2015 20:05:15 +0000 (16:05 -0400)
committerClyne Sullivan <tullivan99@gmail.com>
Sat, 12 Sep 2015 20:05:15 +0000 (16:05 -0400)
src/UIClass.cpp
src/main.cpp

index 319db5c36229da30a5c5ebc78ad837a4e38f6d0b..318ba006bd9705ee489ef77a8cec4c6e87a7ac9c 100644 (file)
@@ -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
+}
index 674acea83f9f7f96e53882f735444477d87451f7..3e8d04f698bf080979053c98e9935f0cfe067ad2 100644 (file)
@@ -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){