aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-09-26 16:44:16 -0400
committerClyne Sullivan <tullivan99@gmail.com>2015-09-26 16:44:16 -0400
commit5781bba3aa5764792b25a1d395cac388d001d713 (patch)
tree0ee3f3bba7a706d117320332b52b8db8ba4d673c /src/ui.cpp
parent75b782c83954e77554d2ad30f9e45e723e91765e (diff)
fixed jumping for real
Diffstat (limited to 'src/ui.cpp')
-rw-r--r--src/ui.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ui.cpp b/src/ui.cpp
index 5cfc492..f849cf8 100644
--- a/src/ui.cpp
+++ b/src/ui.cpp
@@ -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;