summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoresquizo <esquizo+noreply@esquizo.net>2026-05-03 20:52:52 -0300
committeresquizo <esquizo+noreply@esquizo.net>2026-05-03 20:52:52 -0300
commitd174e56e45bb4289b429875376cbaeba73e9bf1b (patch)
tree48aeb4bffa5b546eeb1f67c5b94a9e32c5b36050
parente4a5b88262430a77bf0c9b47acdc8398ff06c899 (diff)
algumas coisas pra melhorar a jogabilidade
-rw-r--r--dat.h2
-rw-r--r--game.c14
2 files changed, 9 insertions, 7 deletions
diff --git a/dat.h b/dat.h
index f0bc5ff..9e69970 100644
--- a/dat.h
+++ b/dat.h
@@ -1,5 +1,5 @@
#define BULLET_SIZE 2
-#define ENTITY_SIZE 16
+#define ENTITY_SIZE 8
typedef struct {
float pos[2];
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;
}
}