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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user