Skip to content

The with directive

In Acid, the with directive is a fundamental part of each program, used in the prelude of a script in order to specify the context or mode in which the program operates. This directive informs the Acid interpreter what kind of procedural generation is being used, thereby determining which builtins, shapes, environment rules, and rendering behaviors are available during execution.

Syntax

with <mode>

Where <mode> is one of the recognized generation types.

Possible modes of operation

  • animation: Designed for 2D procedural animation. Supports shape drawing (circle, square, line, etc.), transformations (e.g., rotate, x2, and properties pos, gridpos per object), and frame-by-frame sequencing. Often used for art or looping visuals.

  • tile: Enables tile-based procedural generation, typically for games or map creation. Includes support for grid-based layouts, tile adjacency rules, randomization seeds, and environmental logic for terrain generation.

Example

with animation

method draw_square_then_circle() {
    square{pos{x: 100, y: 100}} -> circle
}

In this example, the with animation line sets the context for a 2D animation. The draw_square_then_circle method draws a square at position (100, 100) and then transitions to drawing a circle. The -> operator denotes a transformation or sequencing between two shapes — a behavior unique to the animation mode.