]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
gotta go fast
authorClyne Sullivan <tullivan99@gmail.com>
Thu, 29 Oct 2015 13:21:36 +0000 (09:21 -0400)
committerClyne Sullivan <tullivan99@gmail.com>
Thu, 29 Oct 2015 13:21:36 +0000 (09:21 -0400)
1  2 
main.cpp
src/ui.cpp
src/world.cpp

diff --cc main.cpp
Simple merge
diff --cc src/ui.cpp
index 5d6c2abdf1f79c030617b55d184fd802d365b055,e0ebc506bfd5aaf417b21c9f38d7af0f27b79d94..91da2e9d1d408616e7d892edca5a1dd955ae1d46
@@@ -240,31 -238,13 +241,31 @@@ namespace ui 
                                                player->ground=false;
                                        }
                                }
 +                              World *tmp;
                                if(SDL_KEY==SDLK_i){
 -                                      player->vel.y=.5;
 -                                      player->ground=false;
 +                                      tmp=currentWorld;
                                        currentWorld=currentWorld->goWorldBack(player); // Go back a layer if possible  
 +                                      if(tmp!=currentWorld){
 +                                              currentWorld->detect(player);
 +                                              player->vel.y=.2;
 +                                              player->loc.y+=HLINE*5;
 +                                              player->ground=false;
 +                                      }
                                }
 -                              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_k){
 +                                      tmp=currentWorld;
 +                                      currentWorld=currentWorld->goWorldFront(player);        // Go forward a layer if possible
 +                                      if(tmp!=currentWorld){
 +                                              player->loc.y=0;
 +                                              currentWorld->behind->detect(player);
 +                                              player->vel.y=.2;
 +                                              player->ground=false;
 +                                      }
 +                              }
 +                              if(SDL_KEY==SDLK_c){
 +                                      dialogBox("","You pressed `c`, but nothing happened.");
 +                              }
-                               if(SDL_KEY==SDLK_LSHIFT)player->speed = 3;                                                      // Sprint
++                              if(SDL_KEY==SDLK_LSHIFT)player->speed = debug?4:3;                                                      // Sprint
                                if(SDL_KEY==SDLK_LCTRL)player->speed = .5;
                        }
                                if(SDL_KEY==SDLK_F3)debug^=true;
diff --cc src/world.cpp
index 599b1ef8b49e2796c3dd9c5cd9565f79dde33ff1,c04c88a972a07412e57e8cf6acab5919933234b1..641dbf92107710dd8ed5d0b873271d1d2ff17ad7
@@@ -222,7 -222,7 +222,7 @@@ LOOP2
         *      Invert shading if desired.
        */
        
--      //shade*=-1;
++      shade*=-1;
        
        /*
         *      Draw structures in the current layer if we're on the one we started at. We draw
         *      Restore the inverted shading if it was inverted above.
        */
        
--      //shade*=-1;
++      shade*=-1;
        
        /*
         *      Draw platforms...
@@@ -602,7 -582,7 +602,7 @@@ void World::addHole(unsigned int start,
  }
  
  int World::getTheWidth(void){
-       return x_start*2;
 -      return x_start*-2;
++      return -x_start*2;
  }
  
  IndoorWorld::IndoorWorld(void){