aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-10-05 07:31:54 -0400
committerClyne Sullivan <tullivan99@gmail.com>2015-10-05 07:31:54 -0400
commit9c7af916fce7252ee0608be8c918b0378249c832 (patch)
tree6ae05fa843fc550ba36677668b7f602df0219119 /src/ui.cpp
parent1e88bc916af1a76e4790bdfcac459bf7ee3e0d48 (diff)
parente58c8920f5332678e4446a8c33bc74a716024010 (diff)
merge
Diffstat (limited to 'src/ui.cpp')
-rw-r--r--src/ui.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ui.cpp b/src/ui.cpp
index 8b62aab..80ecc69 100644
--- a/src/ui.cpp
+++ b/src/ui.cpp
@@ -187,11 +187,15 @@ namespace ui {
if(SDL_KEY==SDLK_a){ // Move left
left=true;
player->vel.x=-.15;
+ player->left = true;
+ player->right = false;
currentWorld=currentWorld->goWorldLeft(player);
}
if(SDL_KEY==SDLK_d){ // Move right
right=true;
player->vel.x=.15;
+ player->right = true;
+ player->left = false;
currentWorld=currentWorld->goWorldRight(player);
}
if(SDL_KEY==SDLK_s && player->ground==2){
@@ -215,8 +219,8 @@ namespace ui {
KEYUP
*/
case SDL_KEYUP:
- if(SDL_KEY==SDLK_a)left=false; // Stop the player if movement keys are released
- if(SDL_KEY==SDLK_d)right=false;
+ if(SDL_KEY==SDLK_a){left=false;}// Stop the player if movement keys are released
+ if(SDL_KEY==SDLK_d){right=false;}
if(!left&&!right)player->vel.x=0;
if(SDL_KEY==SDLK_LSHIFT)player->speed = 1;