cruxLang

Defining Agents

Create entities that inhabit your world.

Agent Syntax

agent <name>: <type> {
  position: { x: <number>, y: <number> }
  <property>: <value>
  tags: [<tag>, ...]
}

Example

agent alice: visitor {
  position: { x: 10, y: 10 }
  energy: 100
  mood: "happy"
  speed: 2.5
  tags: ["tourist", "morning_person"]
}

Properties

Agents can have any custom properties. Common ones include:

  • position — Location in the world (x, y coordinates)
  • energy — Numeric resource value
  • mood — String state
  • speed — Movement rate
  • tags — Array of string labels for filtering

Types

Agent types are arbitrary strings. Use them to group similar agents and target them in rules.

agent bob: visitor { ... }
agent guard1: security { ... }
agent tree1: decoration { ... }