a little refactoring (Player.runPhysicsAndInput function now does just that, instead of also checking for collisions with enemy)

This commit is contained in:
2025-02-14 11:19:24 +00:00
parent e00db5d8a3
commit 50b57b9ef9
2 changed files with 38 additions and 28 deletions

View File

@@ -13,19 +13,21 @@ struct
, fallingEnemies
} = game
val player = Player.runPhysicsAndInput (game, input)
val enemyTree = Enemy.generateTree enemies
val player = Player.runPhysicsAndInput (game, input, enemyTree)
val player = Player.checkEnemyCollisions (player, enemies, enemyTree)
val enemies = Enemy.update
(enemies, walls, wallTree, platforms, platformTree, player, graph)
(* update state of falling enemies and possibly filter *)
(* todo: use enemy map
val fallingEnemies = FallingEnemies.updateList
(Vector.length fallingEnemies - 1, fallingEnemies, player, [])
val fallingEnemies = Vector.fromList fallingEnemies
*)
(* update state of falling enemies and possibly filter *)
(* todo: use enemy map
val fallingEnemies = FallingEnemies.updateList
(Vector.length fallingEnemies - 1, fallingEnemies, player, [])
val fallingEnemies = Vector.fromList fallingEnemies
*)
in
{ player = player
, walls = walls