From 63dc9b399db9faef611c31629e0265b954d74197 Mon Sep 17 00:00:00 2001 From: drumsetmonkey Date: Sun, 4 Oct 2015 19:35:27 -0400 Subject: Added texture support and textures --- src/ui.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/ui.cpp') 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; -- cgit v1.2.3