tentatively refactor quad tree to make it more succinct + eliminate a class of potential bugs (passing wrong quad values through recursion)

This commit is contained in:
2025-01-27 23:27:52 +00:00
parent 42b42220d0
commit 6369be21fa
14 changed files with 393 additions and 1051 deletions

View File

@@ -320,6 +320,9 @@ struct
let
val player = #player game
val _ = print ("(playerX, playerY) = (" ^Int.toString (#x player) ^ ", " ^
Int.toString (#y player) ^ ")\n")
val patches = getProjectilePatches player
val player = PlayerPatch.withPatches (player, patches)
@@ -427,8 +430,8 @@ struct
val ww = Constants.worldWidth
val wh = Constants.worldHeight
val enemyCollisions = QuadTree.getCollisions
(x, y, size, size, 0, 0, ww, wh, 0, enemyTree)
val enemyCollisions = QuadHelp.getCollisions
(x, y, size, size, enemyTree)
in
Vector.fromList enemyCollisions
end