From 73b4e607aea1af72b85d638277bf9d0d7eaa5ca9 Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Thu, 30 Jan 2025 00:11:01 +0000 Subject: [PATCH] delete function to getPlatformBelowPlayer because it is no longer need now that player stores platID (but still keep function to get platform below enemy as that is still useful) --- fcore/enemy-behaviour.sml | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/fcore/enemy-behaviour.sml b/fcore/enemy-behaviour.sml index 83a6570..0379b20 100644 --- a/fcore/enemy-behaviour.sml +++ b/fcore/enemy-behaviour.sml @@ -115,22 +115,6 @@ struct end | [] => highestID - fun getPlatformBelowPlayer (player, platformTree, platforms) = - let - val {x, y, ...} = player - - val searchWidth = Constants.playerSize - val searchHeight = Constants.worldHeight - y - - val collisions = QuadTree.getCollisions - (x, y, searchWidth, searchHeight, ~1, platformTree) - val checkY = y + Constants.playerSize - - val wh = Constants.worldHeight - in - getHighestPlatform (collisions, platforms, wh, ~1, checkY) - end - fun getPlatformBelowEnemy (enemy: enemy, platformTree, platforms) = let val {x, y, ...} = enemy @@ -373,8 +357,7 @@ struct (player: player, enemy, wallTree, platformTree, platforms, acc) = let (* todo: possibly get pID and eID of player/enemy in a different way *) - val pID = getPlatformBelowPlayer (player, platformTree, platforms) - val pID = if pID = ~1 then #platID player else pID + val pID = #platID player val eID = getPlatformBelowEnemy (enemy, platformTree, platforms) val eID = if eID = ~1 then #platID enemy else eID