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