summaryrefslogtreecommitdiff
path: root/game.c
diff options
context:
space:
mode:
Diffstat (limited to 'game.c')
-rw-r--r--game.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/game.c b/game.c
index fc126a1..fdf0125 100644
--- a/game.c
+++ b/game.c
@@ -81,18 +81,17 @@ void
playerproc(Entity *e, float delta)
{
Entity *bullet;
- const _Bool *kstate = SDL_GetKeyboardState(NULL);
e->body.vel[0] = 0;
e->body.vel[1] = 0;
- if(kstate[SDL_SCANCODE_W])
+ if(moveup)
e->body.vel[1] -= SPEED;
- if(kstate[SDL_SCANCODE_A])
+ if(moveleft)
e->body.vel[0] -= SPEED;
- if(kstate[SDL_SCANCODE_S])
+ if(movedown)
e->body.vel[1] += SPEED;
- if(kstate[SDL_SCANCODE_D])
+ if(moveright)
e->body.vel[0] += SPEED;
if(shot) {