diff options
Diffstat (limited to 'game.c')
| -rw-r--r-- | game.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -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) { |
