class Senses: Component

Senses is used by the sense system as the storage for all of the sensory information from the other sense components/systems. It is required for sight. See the SensesSystem for more.

cells: SparseGrid

A sparse grid of cells representing the portion of the map the actor’s senses reveal.

explored: SparseGrid

A sparse grid of cells the actor’s senses have previously revealed.

remembered: SparseGrid

A sparse grid class that stores data using hashed coordinates. Similar to a SparseMap except here there is only one entry per grid coordinate. This is suitable for stuff like Cells.

exploredStorage: table<Level, SparseGrid>

Weak-keyed storage of explored cells per level.

rememberedStorage: table<Level, SparseGrid>

Weak-keyed storage of remembered cells per level.

unknown: SparseMap<Vector2>

Unknown actors are things the player is aware of the location of, but not the components.

__new(self: Senses, actor: any)
query(self: Senses, level: Level, ...: Component): Query

Queries the level, but only for actors sensed by the component’s owner.

Parameters:
  • level (Level) – The level.

  • ... (Component) – A list of components to pass to the query.