aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-09-28 08:50:24 -0400
committerClyne Sullivan <tullivan99@gmail.com>2015-09-28 08:50:24 -0400
commit7125200e83a9255b8da6745b4a457996705bf263 (patch)
tree52d51815c7112f5195326620ef81907f0147c743 /src/ui.cpp
parent82727d2d50d6a71cd5e9d5a7c00fa41888a39eb7 (diff)
parent113bb97e4ce7db5bc275e0dccf7c790c86cda5d7 (diff)
improvements ;)
Diffstat (limited to 'src/ui.cpp')
-rw-r--r--src/ui.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ui.cpp b/src/ui.cpp
index 9b3cdff..ababe3e 100644
--- a/src/ui.cpp
+++ b/src/ui.cpp
@@ -16,6 +16,7 @@ static bool dialogBoxExists=false;
static const char *dialogBoxText=NULL;
namespace ui {
+ vec2 mouse;
bool debug=false;
unsigned int fontSize;
/*
@@ -132,6 +133,13 @@ namespace ui {
case SDL_QUIT:
gameRunning=false;
break;
+ case SDL_MOUSEMOTION:
+ mouse.x=e.motion.x;
+ mouse.y=e.motion.y;
+ break;
+ /*
+ KEYDOWN
+ */
case SDL_KEYDOWN:
if(SDL_KEY==SDLK_ESCAPE)gameRunning=false; // Exit the game with ESC
if(SDL_KEY==SDLK_a){ // Move left
@@ -167,6 +175,9 @@ namespace ui {
}
break;
+ /*
+ KEYUP
+ */
case SDL_KEYUP:
if(SDL_KEY==SDLK_a)player->vel.x=0; // Stop the player if movement keys are released
if(SDL_KEY==SDLK_d)player->vel.x=0;