in trace-jump.sml, begin descent depending on enemy's size
This commit is contained in:
@@ -38,7 +38,10 @@ struct
|
|||||||
end
|
end
|
||||||
|
|
||||||
fun traceRightJumpAscent (x, y, remainingJump, nextPlatID, platTree) =
|
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)
|
traceRightDescent (x, y, nextPlatID, platTree)
|
||||||
else
|
else
|
||||||
let
|
let
|
||||||
@@ -100,7 +103,7 @@ struct
|
|||||||
end
|
end
|
||||||
|
|
||||||
fun traceLeftJumpAscent (x, y, remainingJump, nextPlatID, platTree) =
|
fun traceLeftJumpAscent (x, y, remainingJump, nextPlatID, platTree) =
|
||||||
if remainingJump >= Constants.jumpLimit then
|
if remainingJump >= Constants.jumpLimit - Constants.enemySize then
|
||||||
traceLeftDescent (x, y, nextPlatID, platTree)
|
traceLeftDescent (x, y, nextPlatID, platTree)
|
||||||
else
|
else
|
||||||
let
|
let
|
||||||
|
|||||||
Reference in New Issue
Block a user