summaryrefslogtreecommitdiff
path: root/game.c
diff options
context:
space:
mode:
authoresquizo <esquizo+noreply@esquizo.net>2026-05-02 14:19:31 -0300
committeresquizo <esquizo+noreply@esquizo.net>2026-05-02 14:19:31 -0300
commitd2d0886cf770488d1b4890a3a414bbf983e784a6 (patch)
treec6ee9e5c2e49aa7175236cfa6596355b16cb71af /game.c
parent34acd612061792a38aa13e376b20f4b5d4b54302 (diff)
desacoplado keys
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) {