# event-flow

Part of the [scripting reference](index.md), written by the engine so it matches your `frost`. Start with [your first game](../start/first-game.md) if you are new.

Use when sending or reading gameplay events, handling contacts, sensors or the order events reach scripts.

| In a script | Does |
| --- | --- |
| `send("event", entity?, value?)` | Queues a world event. A number is sent as a 32-bit float |
| `events("event")` | The queued events of that name, each `{ entity = ..., value = ... }`, and `other` for an event between two entities (see Physics) |
| `events("contact")`, `events("contact_end")` | Two colliders began or stopped touching this step, one or both on a dynamic body: `{ entity, other }` |
| `events("sensor_enter")`, `events("sensor_exit")` | Something came into or left a sensor: `entity` is the sensor, `other` the visitor. A static collider or a tilemap is no visitor unless the sensor's `senses` is `"all"` |

- **Order.** Events come sorted by kind, then by the two entities' slots, `entity` being
  the lower slot for a contact; a list from `physics.overlap` is in slot order. The same
  game gives the same events in the same order on every machine and in a browser.
