aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui.cpp
diff options
context:
space:
mode:
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;