PARTICLE LAB0.1

A JOY GAMES EXPERIMENT

PARTICLE ASSET / .JOYFX

01 Compose

Emitter Stack
SPAWN / UPDATECtrl / Cmd + Enter to apply

02 Preview LIVE

Y-UP / PERSPECTIVE
DRAG TO ORBIT · SHIFT + DRAG TO PAN · SCROLL TO ZOOM
0.00 s6.00 s
0 PARTICLES0 DROPPEDGPU …
Range —Preview FPS — Simulation CPU —Geometry CPU — Draw Calls 0 Triangles 0Lights 0
BOUNDED PARTICLE LANGUAGE

Script Reference

Particles use XYZ world space, with Y up in the perspective preview. Size is in world units; rotation and spin roll the camera-facing sprite. PARTICLE LAB uses its own deterministic language, not JavaScript.

Particle Values

Writable containers: position, velocity, and acceleration are vectors with .x, .y, .z components. color has .r, .g, .b, .a components.

Whole values: velocity = vector(0, 80, 0); color = rgba(1, 0.4, 0.1, 1); position = origin + vector(0, 10, 0); velocity += acceleration * dt; Component writes such as color.a = 1 - t; remain available.

Writable scalars: drag, size, rotation, spin, lifetime, lightIntensity, lightRange, and u0–u3.

u0–u3 are four custom numeric storage slots per particle. They start at zero and persist from spawn through updates; use them to remember an initial size, random phase, or other authored state. Local let values last only for that script invocation.

Read only: origin is the root or parent spawn position; parentVelocity is the parent's velocity at child birth (zero for roots). Both are vectors. Other inputs are dt, age, t, index, time, pi, tau, and named properties.

Vector and color properties use the same component accessors, for example wind.x or tint.a, and can be copied whole: color = tint; Color properties use RGBA in 0–1; scripted particle RGB may exceed one for HDR brightness. Alpha is opacity. Optional lights inherit particle RGB and alpha.

Existing version-1 scalar spellings such as vx, alpha, originX, parentVx, and vector-property X/Y/Z suffixes remain readable for saved assets.

Expressions

Use let, assignments, += -= *= /=, and if (...) { ... } else { ... }. Operators: + - * / % ^ < > <= >= == != && || !.

Functions: sin, cos, tan, abs, sqrt, floor, ceil, round, exp, log, min, max, pow, atan2, clamp, mix, smoothstep, noise, rand, vector, and rgba.

Vectors/colors support same-type addition and subtraction, scalar multiplication and division, and mix(a, b, t). Assignments copy values. Conditions, comparisons, and other math functions use scalars.

Children and Limits

Root emitters run their timeline. Trail and death links spawn particles directly from a child template, inherit parent velocity inputs, and stop after four child generations. Assets allow up to 4,096 live particles, 128 bursts per emitter, 30 seconds per timeline/lifetime, and bounded spawn work. Loops, arbitrary objects, strings, dynamic indexing, and browser or host calls are unavailable.