Documentation
¶
Overview ¶
Package move advances path-following agents across a shared flow field.
Agents are intentionally generic: tower-defense enemies use them today; player-controlled units can reuse the same Transform + Agent stores later. Combat stats (health, reward, armor) stay in game-specific components.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FollowFlow ¶
func FollowFlow( agents *ecs.Store[Agent], transforms *ecs.Store[Transform], field *pathing.Field, g *grid.Grid, tileSize float64, dt float64, )
FollowFlow moves every entity that has both Agent and Transform along field.
Each tick:
- Refresh the cell cache from world position.
- Aim at the center of the next flow-field cell (or stop at the exit).
- Integrate position by Speed * dt toward that target.
Agents on unreachable tiles do not move. tileSize must match the grid used to build field. g may be nil if you only need field sampling (cell refresh still uses tileSize alone).
Types ¶
Click to show internal directories.
Click to hide internal directories.