done getting player's projectiles to collide with enemies successfully, and tested (although the code of the enemy reacting to the player is not the best)

This commit is contained in:
2025-01-11 21:35:55 +00:00
parent 0367b3a23c
commit 75e28b892e
7 changed files with 306 additions and 114 deletions

18
fcore/projectile.sml Normal file
View File

@@ -0,0 +1,18 @@
structure Projectile =
struct
fun helpGenerateTree (pos, projectiles, acc) =
if pos = Vector.length projectiles then
acc
else
let
val size = Player.defeatedSizeInt
val {x, y, facing = _} = Vector.sub (projectiles, pos)
val acc = QuadTree.insert (x, y, size, size, 0, 0, 1920, 1080, pos, acc)
in
helpGenerateTree (pos + 1, projectiles, acc)
end
fun generateTree projectiles =
helpGenerateTree (0, projectiles, QuadTree.empty)
end