precompute graph to be used for dijkstra's algorithm, resulting in CPU usage that never exceed 7/home/humza/Downloads/sml/oh-my-stars/fcore/path-finding.sml with 5 enemies and eliminating lag

This commit is contained in:
2025-01-31 04:32:53 +00:00
parent f3a0b2bc81
commit e23e2f0997
9 changed files with 87 additions and 332 deletions

View File

@@ -12,6 +12,7 @@ struct
, wallTree
, platforms
, platformTree
, graph
) =
let
val {x, y, mainAttack, attacked, ...} = player
@@ -35,6 +36,7 @@ struct
, platforms
, platformTree
, player
, graph
)
(* add collided enemies to player record,
@@ -64,6 +66,7 @@ struct
, platforms
, platformTree
, player
, graph
)
in
(player, enemies)
@@ -89,6 +92,7 @@ struct
, platforms
, platformTree
, player
, graph
)
in
(player, enemies)
@@ -109,6 +113,7 @@ struct
, platforms
, platformTree
, player
, graph
)
in
(player, enemies)