# Gameplay kit

> Aego 0.12.5 · development; docs build `4a32b816933e02930662f6a443cb25abe6050d090c55e237cbff5c44ae9b25f8`. [Build manifest](/docs-build.json).

The gameplay module adds the parts most 2D games rebuild by hand: a character controller, hit points, hitboxes and hurtboxes, kill zones, checkpoints with respawn, pickups and timed removal. They are components, so they are set up in the Inspector, saved with the scene and driven from scripts with a few calls.

Quick start: Create → Gameplay → Platformer Character gives a node with a kinematic Rigid Body 2D, a collider, Motion 2D, Health, Hurtbox 2D and Respawn. Give it a script that calls `Move` and `Jump`, add a floor and press Play.

In the interactive guide, walk with A/D or the arrow keys and jump with Space, W or Up.

Two complete games use the kit: `aego new mygame --example platformer` (stomping enemies with a foot hitbox, a pit with a kill zone, a checkpoint, a persisted respawn point and an Animator for the player's look, with a slash on a hit frame) and `aego new mygame --example topdown` (a sword swung towards the stick, the mouse or the walking direction, enemies whose State Machine switches between Patrol and Chase while their Animator shows it, a lunge by root motion, coins and lava). The launcher offers both under **Examples**.

| Component | Purpose |
|---|---|
| Motion 2D | walks, jumps and slides a kinematic body: slopes, steps, moving platforms, top-down movement |
| Health | hit points, team, invulnerability after a hit, death and revive |
| Hurtbox 2D | area where hitboxes hurt a Health |
| Hitbox 2D | area that damages hurtboxes, with knockback |
| Lifetime | removes a node after some seconds |
| Kill Zone 2D | kills or respawns what falls into it |
| Checkpoint 2D | moves the respawn point |
| Respawn | brings a node back to its respawn point |
| Pickup 2D | fires `Collected` when a character touches it |
| State Machine | named states with Enter, Exit, Fixed and Update hooks in the node's scripts |

Everything runs during Play and in `aego run`, in the fixed step, and allocates nothing per step. Hurtboxes, hitboxes and zones are areas in their node's space, not physics colliders: they never push anything and need no collision layers.
