> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rollingquest.kramgames.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Balls

> How to place, configure, and manage balls in the RollingQuest level editor. Direction, skin, execution order, and pattern balls.

Balls are the player-controlled entities in RollingQuest. In the editor, you place ball templates on block sides to define where the player starts and how the ball behaves.

## Placing Balls

1. **Left-click** a block side to select it
2. Press **P** to open the Balls Pool
3. Select a ball template from the grid — it is placed on the selected side
4. The ball appears with a direction arrow indicating its initial orientation

If a ball already exists on the selected side, pressing **P** opens the Element Properties menu for that ball.

## Removing Balls

1. Select the side with the ball
2. Press **P** to open the Balls Pool
3. Select the **None** option

## Ball Properties

Balls have the most configurable properties of any element:

### Direction

Set the ball's initial rolling direction:

* **North** — Default direction
* **East** — 90° clockwise from North
* **South** — 180° from North
* **West** — 270° from North

The direction is visualized with an arrow on the ball in the editor.

### Skin

For balls with multiple visual variants:

* Select from available skins in the dropdown
* Skins may be locked behind progression (shown with "???")
* Developer Mode bypasses skin locks

### Execution Order

When multiple balls exist in a level, the order determines which ball is processed first:

* Order values range from 1 to the total number of balls
* Changing one ball's order automatically reorders the others to prevent conflicts
* The `BallsManager` sorts balls by their order value

### Ball Style (Pattern Balls)

For balls with `IsPatternBall` enabled:

* Press the **Select Style** button in the Element Properties menu
* Opens the Ball Style Selector with a grid of available patterns
* Selecting a pattern applies it to the ball's visual appearance

### Script Attachment

Like all elements, balls can have Lua scripts attached with tags and local variables.

## Global Ball Management

The editor maintains a global `BallsManager` that tracks all balls across all sections. When a ball is placed:

1. It is inserted into the global ball manager
2. It is added to the current section's ball list
3. All balls are re-numbered to maintain consistent order
4. The score info is marked as outdated and recalculated

When a ball is removed:

1. It is removed from the global manager
2. It is removed from the section's ball list
3. Remaining balls are re-numbered

## Multi-Section Balls

Balls are associated with specific sections. When you switch sections, only balls belonging to that section are visible and editable. The global ball manager maintains the order across all sections.
