add code so that enemy gains a new projectile when attacking falling enemies, and also draw the falling enemies

This commit is contained in:
2025-02-08 10:48:34 +00:00
parent 51401231e1
commit 26870816db
3 changed files with 62 additions and 1 deletions

View File

@@ -451,8 +451,16 @@ struct
| FACING_LEFT => x - length)
val state = []
(* detect collisions from enemies who are hit by attack *)
val newDefeated = AttackEnemies.foldRegion
(x, y, length, height, (), state, enemyTree)
(* detect collisions from falling enemies too *)
val fallingTree =
FallingEnemies.generateTree (#fallingEnemies game)
val newDefeated = AttackEnemies.foldRegion
(x, y, length, height, (), newDefeated, fallingTree)
val allDefeated =
Vector.concat [Vector.fromList newDefeated, enemies]
in