diff options
Diffstat (limited to 'src/UIClass.cpp')
-rw-r--r-- | src/UIClass.cpp | 85 |
1 files changed, 63 insertions, 22 deletions
diff --git a/src/UIClass.cpp b/src/UIClass.cpp index c17b6a7..bf76336 100644 --- a/src/UIClass.cpp +++ b/src/UIClass.cpp @@ -1,22 +1,63 @@ -#include <UIClass.h>
-
-void UIClass::handleEvents(){
- SDL_Event e;
- while(SDL_PollEvent(&e)){
- switch(e.type){
- case SDL_QUIT:
- gameRunning=false;
- break;
- case SDL_KEYDOWN:
- switch(e.key.keysym.sym){
- case 27:
- gameRunning=false;
- break;
- default:
- break;
- }
- default:
- break;
- }
- }
-}
+<<<<<<< HEAD +#include <UIClass.h> +extern Player player; + +void UIClass::handleEvents(){ + SDL_Event e; + while(SDL_PollEvent(&e)){ + switch(e.type){ + case SDL_QUIT: + gameRunning=false; + break; + case SDL_KEYDOWN: + switch(e.key.keysym.sym){ + case 27: ///ESCAPE + gameRunning=false; + break; + case SDLK_d: ///D + player.velg.x = 10; + break; + case SDLK_a: ///A + player.velg.x = -10; + break; + default: + break; + } + case SDL_KEYUP: + switch(e.key.keysym.sym){ + /*case SDLK_d: ///D + break; + case SDLK_a: ///A + break;*/ + default: + break; + } + default: + break; + } + } +} +======= +#include <UIClass.h> + +void UIClass::handleEvents(){ + SDL_Event e; + while(SDL_PollEvent(&e)){ + switch(e.type){ + case SDL_QUIT: + gameRunning=false; + break; + case SDL_KEYDOWN: + switch(e.key.keysym.sym){ + case 27: + gameRunning=false; + break; + default: + break; + } + default: + break; + } + } +} +>>>>>>> origin/master |