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;
* 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...
}
int World::getTheWidth(void){
- return x_start*2;
- return x_start*-2;
++ return -x_start*2;
}
IndoorWorld::IndoorWorld(void){