courseKit
Build a 3D platformer course or obstacle course in code from pieces (decks, stairs, bridges, ledges, slides, jump gaps, arenas, spiral climbs, lantern gates, crumble stairs and wind gaps) and switch the look of the whole course with **one call**.
courseKit: course blocks for 3D platformer levels
Build a 3D platformer course or obstacle course in code from pieces (decks, stairs, bridges, ledges, slides, jump gaps, arenas, spiral climbs, lantern gates, crumble stairs and wind gaps) and switch the look of the whole course with one call.
local Course = require("courseKit.api")
Course.setLook("candy") -- storybook, alpine, candy, ruins, scifi, desert
local f = Course.frame({ 0, 10, 0 }, 90) -- author in metres along (s), to the right (l), up (h)
Course.beginRun()
Course.deck("Start", f.p(0, 0, 0), 6, 6, f.yaw)
local _, a = Course.place("bridge", "rope", "RopeBridge", f.p(3, 0, 0), f.yaw)
local _, b = Course.place("gate", "arch", "Gate1", a.exit, a.yaw) -- checkpoint archway
local _, c = Course.place("spiral", "tree", "TreeClimb", b.exit, b.yaw)
local _, d = Course.place("wind", "updraft", "Updraft", c.exit, c.yaw)
local _, e = Course.place("crumble", "stairs", "Crumble", d.exit, d.yaw)
Course.deck("Goal", e.exit, 6, 6, e.yaw)
Course.killUnder("Net", nil, { label = "the river" }) -- Trapline safety net under all of it
Piece kinds × looks
| kind | variants | call |
|---|---|---|
| climb | stairs, steps (floating blocks), switchback | stairs, steps, switchback |
| ledge | narrow (beam walk), wall (ledges out of a wall) | ledge, wallLedges |
| bridge | plank, rope (sagging, rope rails), arch (stone arch) | bridge(..., { kind = }) |
| slide | chute (walled), slope (open): the player slides down, speeding up | slide |
| gap | pads, pillars: every gap 1.8 m or less by default (a running jump carries about 2.5 m), max 2.2 m | gaps |
| arena | round, square: floor, rim, gates, edge posts | arena |
| spiral | stair (steps cantilevered from a pillar), ledges (separate ledges a short hop apart), tree (plank steps round a great trunk under a crown): one turn of 3.6 to 4.2 m, ending straight above its start | spiral |
| gate | arch (two lanterns), grand (tie beam, plaque, three lanterns), festoon (a string of small lanterns): a walk-through archway on its own deck in the theme's lantern style, carrying a Trapline checkpoint (checkpoint = false for none) | gate |
| crumble | stairs (rising flight), run (level row over a gap), zigzag (alternating steps): platformsKit crumble platforms that shake, break and come back, in a frame of the course look | crumbleStair |
| wind | updraft (one platformsKit fan lifts you to a higher landing), fans (two air columns to hop between), crosswind (a courseKit.Wind tunnel blows you along and holds you up across a 9 m gap) | windGap |
Course.place(kind, variant, name, at, yaw, opts) builds any of them at a standard size and answers { exit, yaw, tops }, so pieces chain. Every walkable part has a box collider a CharacterController stands on and records its footprint for killUnder; opts.net = true (or a table of killUnder options) also puts a Trapline safety net under that one piece.
Themes (Course.setLook(name), or setDefaults({ theme = name })): storybook (toon planks, carved rims, trail signposts, iron lanterns), alpine (snow-topped wood, snowy signposts, timber lanterns, lake), candy (pink frosting, cream piping, candy canes, lollipop signs), ruins (weathered stone, mossy edge stones, stone tablets, braziers), scifi (metal plates, glowing edges, holo panels, light pylons), desert (sandstone on masonry piers). A theme sets every family at once: deck, sign, lantern, water, platform re-skin and platformsKit look. Single deck looks (snowTop, timber, mossyStone, ice, floe, ropePlank, meadow, industrial) can be picked per piece with { look = ... }, and defineLook / defineLantern add your own.
Also in the kit
deck,ramp,pillar,water: walkable parts with box colliders;top/rim/postoverride materials per piece.killStrip/killUnder: Trapline KillZone safety nets;killUndersizes itself from the footprints every walkable piece records (sincebeginRun, or a list of pieces).sign: alpineProps carved trail signposts, orcourseKit.SignBoardlettered boards (board, stone, candy, scifi).lanternPost: six built-in lantern styles or your own model (defineLantern).prop,trees,props: alpineProps / forestProps toon props along the course.platform: a platformsKit platform in the theme's look;reskin/courseKit.Reskindresses one in a course material set (e.g.floe: snow top, teal ice body).
What is inside
api.module: the front door (courseKit.api).pieces.module: climbs, ledges, slides, gaps, arenas, spiral climbs, lantern gates, crumble stairs, wind gaps,place.parts.module: decks, ramps, stairs, bridges, pillars, water, kill strips, signs, lanterns, props, platforms.core.module: look defaults, frames, box parts, footprints.looks.module: the look catalog (themes, deck/water/sign/lantern/re-skin looks, the material palette).Slide.component,Wind.component,Reskin.component,SignBoard.component.materials/: candy, sci-fi, rope, lantern glow, lava, snow deck and ice floe materials.courseKit.testSuite: tests;guides/: how to build a course.
Depends on platformsKit (and the Trapline it brings), alpineProps, forestProps (alpineProps' sign lettering is built with its Geo module) and toonMaterials; optional material collections (woodsMaterials, stoneMaterials, groundMaterials, alpineMaterials, animatedMaterials) are used when installed. The world "Course Blocks" shows every kind, one theme column at a time (set THEME in its build), in its courseShowcase scene.
Scoped to this part · feeds back into the world's score.