diff options
| author | esquizo <esquizo+noreply@esquizo.net> | 2026-05-02 14:19:31 -0300 |
|---|---|---|
| committer | esquizo <esquizo+noreply@esquizo.net> | 2026-05-02 14:19:31 -0300 |
| commit | d2d0886cf770488d1b4890a3a414bbf983e784a6 (patch) | |
| tree | c6ee9e5c2e49aa7175236cfa6596355b16cb71af /game.c | |
| parent | 34acd612061792a38aa13e376b20f4b5d4b54302 (diff) | |
desacoplado keys
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) { |
