add function to generate quad tree from falling enemies

This commit is contained in:
2025-02-15 01:52:19 +00:00
parent e758a5a13c
commit b8934e3add
2 changed files with 28 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
structure PlayerAttack =
struct
(* - Handle collisions where player hits enemy directly - *)
structure AttackEnemies =
structure PlayerAttackEnemy =
MakeQuadTreeFold
(struct
type env = unit
@@ -45,7 +45,7 @@ struct
FACING_RIGHT => x + Constants.playerSize
| FACING_LEFT => x - length)
val (defeatedList, enemyMap) = AttackEnemies.foldRegion
val (defeatedList, enemyMap) = PlayerAttackEnemy.foldRegion
(x, y, length, height, (), ([], enemyMap), enemyTree)
val defeatedList = Vector.fromList defeatedList