fix bug in physics.sml where player/enemy would drop below continuously past multiple platforms even if they intended to drop below platforms only once (fixed by setting yAxis to 'FALLING' if there are no collisions at all and player is in DROP_BELOW_PLATFORMS state)
This commit is contained in:
@@ -153,6 +153,22 @@ struct
|
||||
(x, y, size, size, 0, 0, ww, wh, 0, platformTree)
|
||||
val acc = getPlatformPatches (yAxis, platforms, platCollisions, [])
|
||||
|
||||
val acc =
|
||||
case yAxis of
|
||||
DROP_BELOW_PLATFORM =>
|
||||
(* if we dropped below platform before
|
||||
* but we have fully passed the platform now
|
||||
* such that there are no platform collisions
|
||||
* then set new yAxis to FALLING
|
||||
* so we do not drop below any platforms again
|
||||
* *)
|
||||
if QuadTree.hasCollisionAt (x, y, size, size, 0, 0, ww, wh, ~1,
|
||||
platformTree)
|
||||
then
|
||||
Fn.W_Y_AXIS FALLING :: acc
|
||||
else acc
|
||||
| _ => acc
|
||||
|
||||
val wallCollisions = QuadTree.getCollisionSides
|
||||
(x, y, size, size, 0, 0, ww, wh, 0, wallTree)
|
||||
in
|
||||
|
||||
Reference in New Issue
Block a user