VERTEXDocsGitHub

Cartridge reference

A cartridge is one JSON document: a scene plus behavior. Every field is optional. Machine-readable schema: schema/scene.schema.json; normative spec: SPEC.md §2.

Top level#

FieldTypeDefault
title, descriptionstringmetadata
width, heightnumber800, 600world/screen size in world units
backgroundcolor#000
shapes{name: Shape}below
entitiesEntity[]below
stateobject{}game-wide JSON; state.hud is drawn as text
keys{key: action}KeyboardEvent.key → action name
systems(name | {name: arg})[]["rules","motion","wrap","lifetime"]the loop, in order: systems
rulesRule[]rules
sounds{name: Sound}below
camera{x, y, zoom?, rot?}noneworld point at screen center; none = top-left origin
scenes{name: {entities, state?, camera?}}for goto(name)
physics{gravity?: [x, y], iterations?, slop?}[0, 900], 4, 0.01
streaming{chunk?, radius?, focus?, plane?, keep?}512, 1, "player", "xy", []worlds
space{camera, light?, ambient?, fog?}3D: 3d
dialogue{id: {start?, nodes}}worlds
dialogueStyle{speed, size, panel, border, textColor, …}
interaction{focus?}"player"who triggers interact
multiplayer{player, spawn, interest, publicData, sendRate, …}multiplayer

Shapes#

{ "ship": { "d": "M12 0 L-8 -8 L-4 0 L-8 8 Z", "fill": "#0b1020", "stroke": "#7df9ff", "width": 2 } }
Field
dSVG path dataM L H V C S Q T A Z, absolute and relative; centered on the pivot
fillcolor or gradient{type: "linear", x1, y1, x2, y2, stops: [[0, "#fff"], [1, "#000"]]} or {type: "radial", cx, cy, r, stops}
stroke, widthcolor, number
clippath dataclip this part to a region
partsShape[]several paths drawn as one shape
mesh{v: [[x,y,z]…], f: [[i,j,k…]…], colors?}3D; plus shade, doubleSided
extrude{d, depth}3D solid from a 2D path

Colors: #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(), rgba(), a few names, none.

Entities#

{ "id": "hero", "shape": "hero", "x": 60, "y": 200, "tags": ["player"], "body": {}, "data": { "hp": 3 } }
FieldDefault
ide1, e2, …unique
shapename in shapes (or null)
d / textinline path, or text in the vector font (size 16, align center)
fill, stroke, widthstyle for d/text
x, y, rot, scale0, 0, 0, 1rot in radians, 0 faces +x
vx, vy, vr0velocities (units/s, rad/s), integrated by motion
dragvelocity loss per second, 0–1
z, rx, ry, rz, vz, vrx, vry, vrz3D (ry = yaw)
layer0draw order
parallax, fixed, hidden1, false, falsecamera influence; screen-space UI; skip drawing
tags[]what systems and rules select on
data{}your fields; data.ttl = seconds to live (lifetime)
bodyphysics: {static, sensor, collider: "box"|"circle", restitution, friction, mass, gravity}; read ground, wall
emitterparticles: {shape, rate, burst, life, speed, angle, scale, spin, gravity, shrink, max, tags}
interact{prompt, radius, dialogue, do, once}

Sounds#

{ "jump": { "wave": "square", "freq": 330, "slide": 900, "decay": 0.12, "volume": 0.3 } }

wave (square saw sine triangle noise), freq Hz, slide Hz/s, attack/sustain/decay s, volume, vibrato Hz + vibratoRate, duty (square), lowpass Hz, seed (noise).

Edit this page