From d174e56e45bb4289b429875376cbaeba73e9bf1b Mon Sep 17 00:00:00 2001 From: esquizo Date: Sun, 3 May 2026 20:52:52 -0300 Subject: algumas coisas pra melhorar a jogabilidade --- game.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'game.c') diff --git a/game.c b/game.c index 12239d0..b41c501 100644 --- a/game.c +++ b/game.c @@ -136,11 +136,13 @@ ghostproc(Entity *e, float delta) float dy = player->body.pos[1] - e->body.pos[1]; float dd = sqrtf(dx * dx + dy * dy); - dx /= dd; - dy /= dd; + if(dd < 400.0) { + dx /= dd; + dy /= dd; - vx += dx * SPEED; - vy += dy * SPEED; + vx += dx * SPEED; + vy += dy * SPEED; + } for(int j = 0; j < 1024; j++) { other = entitybuffer + j; @@ -155,8 +157,8 @@ ghostproc(Entity *e, float delta) dy /= dd; if(dd < 40) { - vx -= dx * SPEED; - vy -= dy * SPEED; + vx -= dx * SPEED * 2; + vy -= dy * SPEED * 2; } } -- cgit v1.2.3