Docs · Sandboxes
One mechanic, no genre
A sandbox shows a single engine primitive in isolation, knobs exposed — how a part is used, without smuggling in a whole game's design. Learn the API here; decide what to build somewhere else entirely.
Run the shelf
git clone https://github.com/hellojanpacan/hayao-js && cd hayao-js
npm install && npm run dev
# then open http://localhost:5180/sandboxes/<lab>/Physics
physics-labcreateRigidWorld
Rigid bodies, joints, raycasts. Spawn and drop bodies; tune gravity and restitution.
SourceParticles
particle-workshopParticles + PARTICLE_PRESETS
Every preset, with count, gravity and spread on sliders.
SourceCamera
camera-labCamera2D + CameraController
Deadzone, smoothing, shake and bounds — feel the follow rules directly.
SourcePathfinding
pathfinding-demoastarGrid / floodFill
Paint walls, move the goal, toggle diagonals; watch the search respond.
SourceJuice
juice-labEASINGS + AnimationPlayer + spring
Every easing curve side by side — pick feel by eye, not by name.
SourceProcgen
procgen-labgenerateCave + valueNoise + autotile
Re-roll the seed, tune fill and smoothing; same seed, same cave, every time.
SourceSynth
synth-labthe audio bus
Pitch, wave, envelope — hear a SoundSpec take shape as you drag.
SourceAnimation
anim-labBone2D + ClipPlayer + Blend1D + IK
Blend idle↔wave, reach for the pointer with IK, toggle the skeleton overlay.
SourceWebGL effects
webgl-labWebGL2Renderer + BLOOM_PIPELINE
Cycle eight post-process effects; burst particles; stress-test the storm.
SourceCards
card-labmakeCard + resourceGlyph
Four card anatomies from the slot-stack kit, in day and night themes.
SourceHero rig
hero-labthe duotone hero + seven clips
The whole cast sheet playing at once — jump, spawn and death on auto-replay.
Source2D lighting
light-labLightLayer + PointLight + occluders
Two lights carving pools out of ambient dark; drive one, the other orbits.
SourceThe sandbox contract
Lighter than an example, honest like one
- Import only from
@hayao— same seam as everything else. - Deterministic — re-roll a seed and it re-derives identically.
- View nodes are cosmetic — knob state is canonical, paint stays out of the hash.
- Headlessly inspectable — every lab exposes a
probe(world). - No win, no lose, no genre — if it starts feeling like a game, it belongs in
examples/.