VERTEXDocsGitHub

Systems reference

"systems" is the game loop, run in order every step. Events reach only systems listed after the one that emits them, so "rules" usually goes after collide/physics.

SystemDoesEmits
"rules"runs the cartridge's rules (at most once in the list)your events
"motion"x += vx·dt, y += vy·dt, rot += vr·dt; applies drag
"wrap"entities tagged wrap re-enter from the opposite edge
"lifetime"counts down data.ttl, despawns at 0
{ "collide": [[a, b], …] }bounding-circle overlap between tag pairshit
{ "collideOutline": [[a, b], …] }exact outline overlaphit
"physics"gravity, solid bodies, restitution, friction, sensors; sets body.ground / body.wallcontact
"particles"runs entity emitters (client-side only when online)
{ "follow": id | {id, lerp} }2D camera eases toward an entity
"streaming"sleeps/wakes chunks around focus entities (put first)chunkEnter, chunkLeave
"interact"nearest interact entity per player, prompt, triggersinteract
"dialogue"runs conversations and draws the dialogue boxdialogue, choice, dialogueEnd
"motion3d"integrates vz, vrx, vry, vrz
{ "chase": id | {id, distance, height, lerp, pitch} }3D camera behind an entity
{ "collide3d": [[a, b], …] }oriented mesh-bound boxes in 3Dhit
"morph" · "keyframes"path morphing (data.morph) · keyframed transforms (data.keys)

Typical orders:

Gamesystems
arcade["motion", "wrap", "lifetime", {"collide": [...]}, "rules"]
platformer["motion", "physics", "particles", "lifetime", "rules", {"follow": "player"}]
open world["streaming", "rules", "motion", "physics", "interact", "dialogue"]
3D["rules", "motion", "motion3d", {"collide3d": [...]}, {"chase": "player"}]

In JavaScript, a system is any (game, dt) => void; add it with game.use(fn).

Edit this page