aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui.cpp
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2015-09-28 08:47:43 -0400
committerdrumsetmonkey <abelleisle@roadrunner.com>2015-09-28 08:47:43 -0400
commit113bb97e4ce7db5bc275e0dccf7c790c86cda5d7 (patch)
tree6db84a77b149476ecd45f838237385ab7d360cf3 /src/ui.cpp
parent9630c8a49cbad7b1b71b9401ff24881ebf4c7c25 (diff)
Added enum for types and improved NPCs
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 75bc5ee..0789994 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
@@ -166,6 +174,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;