From 55a4aed50112c06991d1dbb6199248bb4083c6a9 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Fri, 7 Jul 2023 07:21:18 +0100 Subject: Prevent Mr Bones to get stuck turning when can't reach the player --- src/old.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/old.c') diff --git a/src/old.c b/src/old.c index 3451118..dcb2994 100644 --- a/src/old.c +++ b/src/old.c @@ -13,8 +13,6 @@ #define FRAME_JUMPING 1 #define WALK_CYCLE_FRAMES 4 -#define JUMP_DELAY 2 - static const Rect frames[2 * 4] = { /* right */ @@ -77,7 +75,7 @@ void old_update(Entity *e) { e->gravity = GRAVITY_OFF; e->frame = FRAME_STANDING; - e->flags = rand() % (JUMP_DELAY * 2); + e->flags = rand() % (ENEMY_JUMP_DELAY * 2); break; } e->y++; @@ -110,7 +108,7 @@ void old_update(Entity *e) else e->x++; - if (e->flags > JUMP_DELAY + if (e->flags > ENEMY_JUMP_DELAY && map_is_blocked(e->x + 7, e->y - 1) && !map_is_blocked(e->x + 7, e->y - 9)) { @@ -130,7 +128,7 @@ void old_update(Entity *e) else e->x--; - if (e->flags > JUMP_DELAY + if (e->flags > ENEMY_JUMP_DELAY && map_is_blocked(e->x + 7, e->y - 1) && !map_is_blocked(e->x + 7, e->y - 9)) { -- cgit v1.2.3