implement function to trace drop (while moving right)

This commit is contained in:
2025-01-29 19:35:40 +00:00
parent 97a638b54d
commit 89abab31ab
2 changed files with 25 additions and 9 deletions

View File

@@ -244,14 +244,20 @@ struct
end
fun getMoveRightPatches (nextPlatform, enemy, platformTree, acc) =
if TraceJump.traceRightJump (enemy, #id nextPlatform, platformTree, nextPlatform) then
(* important to check for drop first because path of traceRightJump includes
* descent of jump/drop.
* So, if we check for jump first, we would always jump before dropping
* even if jumping is not necessary. *)
if TraceJump.traceRightDrop (enemy, #id nextPlatform, platformTree) then
EnemyPatch.W_Y_AXIS DROP_BELOW_PLATFORM ::
EnemyPatch.W_X_AXIS MOVE_RIGHT ::
acc
else if TraceJump.traceRightJump (enemy, #id nextPlatform, platformTree) then
if standingOnArea (enemy, platformTree) then
EnemyPatch.W_Y_AXIS (JUMPING 0) :: EnemyPatch.W_X_AXIS MOVE_RIGHT :: acc
else
EnemyPatch.W_X_AXIS MOVE_RIGHT :: acc
else
(* placeholder: should check if we can move to the next platform while
* dropping *)
EnemyPatch.W_X_AXIS MOVE_RIGHT :: acc
fun getMoveLeftPatches (nextPlatform, enemy, platformTree, acc) =