Platform Playground: Moving, Crumbling and Bouncy Platforms Kit
README.md
platformsKit tests
Checks everything the platformsKit offers, in edit mode:
- catalog: 19 kinds, 7 looks, 133 uniquely named entries, every row tagged with its kind and look,
list()with nil / a kind / a look / a tag / a word of the name / a{ kind, look, tag }table,get,isKind/isLook, rows handed out as copies, the markdown table. - motion (pure maths): vectors and quaternions (
qrot,qmul,qconj,compose,carryPointkeeps a rider's local offset), path loops (start, every stop, waits, laps), ping-pong round trips, lap and round-trip lengths, triggered runs resting before and after, continuous and stepped spinners, beat on / warning / off and offsets, break phases andbreakBusy, the falling drop curve, elevators (idle, one call, a call queued while moving, the same answer whatever order calls arrive in, always-on), seesaw target and settling, rope swing damping and pumping, launch speed (v² = 2gh). - net: applying touch / go / call / grab / release (sorted, de-duplicated, capped), listeners and
Disconnect, localsend, snapshot + merge of two machines in either order giving the same state,resetof one key. - clock:
now()moves forward in edit mode;_samplekeeps the shortest round trip, blends close answers and ages an old best out (its state is saved and restored). - every platform builds: all 133 kind x look platforms spawn with a Platform, a mover, the right collider count (ladder and rope none, mushroom 2, elevator 1 + one per floor, button triggers one more), every builder runs without error, every kind's defaults come from the catalog.
- switching:
api.setKind/api.setLookrebuild at once; settingkind,lookor any other field on the component rebuilds on the next frame. - Platform methods:
poseAtmatches the motion maths (offset included),isSolidfollows the beat,press()starts one step-triggered run and calls an elevator to a floor,touch()breaks a crumble and drops a fall. - rider: no player in edit mode;
override/base/ restore,setVerticalVelocity,launchcooldown, intent, iceslip, ladder/ropeclaim, collider registry, all on a fake controller table. - api: lists, spawn (name, position, fields), refusing unknown kinds and looks,
get,onreturning a connection,now. - first example: adding the Platform component to a plain entity (the component's own header example).
It spawns temporary platforms far from the scene (x ≈ 3000, y = 500) and despawns them after each test, resets every net key it touched (test_pk_* and the spawned entity ids), and resets the rider. Two-player networking and a real player riding platforms are play-tested instead.
Run it in edit mode:
zero tests run platformsKit
or from Luau: tools.use("tests", "run", "platformsKit").
1.1.0 group
Eight more tests for what 1.1.0 added: exact kind/look filters and unique tags, the host's per-peer clock report (Clock._report, Clock.info().peers), RiderGlue (resolves; R.glue puts a grounded rider back on the drawn surface and leaves them alone off the edge, jumping, in the air, too far off, or on a stale pose), every Platform setting replicating, colliders switched by moving (never removed), PK.spawn with temporary, yaw and vector paths, a destroyed platform forgetting its events, and one version across the README, package.yaml and PK.VERSION. 72 tests in all.
1.2.0 group ("phone")
Six more: every kind in every look builds in lite with fewer parts (at least a fifth fewer overall) and the same colliders; lite keeps the cues that say what a platform does (beat lights and ghost, fall warning, conveyor chevrons, spring coil and pad); no part smaller than SHADOW_MIN casts a shadow; the draw distance hides a platform and draws it again, with every part back; switching detail rebuilds placed platforms, including hidden ones; unknown detail levels and bad distances are refused. 78 tests in all.
1.6.0 group
Ten more: the industrial and nature looks' palettes and shape families; swing, sink and fan building in every look with the parts they animate, and every falling platform's warning frame hidden until touched; the swing's pendulum period and level deck; sinking and rising; the updraft's speed and hover; the spring squash curve; a fresh swing, sink and fan getting the documented defaults; every sound rendering in every look, levelled and different between looks; sounds only in play mode and PK.setVolume / PK.volume; the README's Kinds and Looks tables matching the catalog. 107 tests in 21 groups.