From 2446f3ea145e4211ead1c595979bcaf0d4040c0f Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Wed, 29 Jan 2025 23:51:02 +0000 Subject: [PATCH] in trace-jump.sml, begin descent depending on enemy's size --- fcore/trace-jump.sml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fcore/trace-jump.sml b/fcore/trace-jump.sml index 82577db..59533ac 100644 --- a/fcore/trace-jump.sml +++ b/fcore/trace-jump.sml @@ -38,7 +38,10 @@ struct end fun traceRightJumpAscent (x, y, remainingJump, nextPlatID, platTree) = - if remainingJump >= Constants.jumpLimit then + (* because value of y parameter is at the top, + * we subtract the jump limit by the enemy's size, + * so we only check for places enemy can jump to. *) + if remainingJump >= Constants.jumpLimit - Constants.enemySize then traceRightDescent (x, y, nextPlatID, platTree) else let @@ -100,7 +103,7 @@ struct end fun traceLeftJumpAscent (x, y, remainingJump, nextPlatID, platTree) = - if remainingJump >= Constants.jumpLimit then + if remainingJump >= Constants.jumpLimit - Constants.enemySize then traceLeftDescent (x, y, nextPlatID, platTree) else let