diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2015-09-26 16:44:16 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2015-09-26 16:44:16 -0400 |
commit | 5781bba3aa5764792b25a1d395cac388d001d713 (patch) | |
tree | 0ee3f3bba7a706d117320332b52b8db8ba4d673c /src/ui.cpp | |
parent | 75b782c83954e77554d2ad30f9e45e723e91765e (diff) |
fixed jumping for real
Diffstat (limited to 'src/ui.cpp')
-rw-r--r-- | src/ui.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -142,7 +142,12 @@ namespace ui { player->vel.x=.15; currentWorld=currentWorld->goWorldRight(player); } - if(SDL_KEY==SDLK_SPACE)player->vel.y=.25; // Jump + if(SDL_KEY==SDLK_SPACE){ // Jump + if(player->ground){ + player->vel.y=.25; + player->ground=false; + } + } if(SDL_KEY==SDLK_i)currentWorld=currentWorld->goWorldBack(player); // Go back a layer if possible if(SDL_KEY==SDLK_k)currentWorld=currentWorld->goWorldFront(player); // Go forward a layer if possible if(SDL_KEY==SDLK_F3)debug^=true; |