Log inGet started
Package

courseKit.package

Newest version

README.md

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

kindvariantscall
climbstairs, steps (floating blocks), switchbackstairs, steps, switchback
ledgenarrow (beam walk), wall (ledges out of a wall)ledge, wallLedges
bridgeplank, rope (sagging, rope rails), arch (stone arch)bridge(..., { kind = })
slidechute (walled), slope (open): the player slides down, speeding upslide
gappads, pillars: every gap 1.8 m or less by default (a running jump carries about 2.5 m), max 2.2 mgaps
arenaround, square: floor, rim, gates, edge postsarena
spiralstair (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 startspiral
gatearch (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
crumblestairs (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 lookcrumbleStair
windupdraft (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/post override materials per piece.
  • killStrip / killUnder: Trapline KillZone safety nets; killUnder sizes itself from the footprints every walkable piece records (since beginRun, or a list of pieces).
  • sign: alpineProps carved trail signposts, or courseKit.SignBoard lettered 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.Reskin dresses 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.