Arena Layout Kit: Rings, Pillars, Corridors, Bunkers and Hazard Lanes
README.md
Arena Layout Kit
Six combat arenas for top-down shooters, twin-stick games, brawlers and wave survival, built in one call, each with a floor, colliders on every wall, enemy spawn gates and player starts.
local Arenas = require("arenaLayoutKit.api")
-- in a scene's content() or any time in edit or play
local root, plan = Arenas.build("pillars", { center = { 0, 0, 0 }, radius = 20, theme = "desertRuins" })
The layouts (Arenas.LAYOUTS)
| id | what it plays like |
|---|---|
ring | A wide open circle walled in. Pure dodging and kiting. |
pillars | Two rings of columns to weave between and break line of fire (the default). |
cross | Four wall blocks carve a plus-shaped set of corridors: choke points and corners. |
bunkers | Four roofless houses, one per quarter, doorways facing the centre. |
shrinking | An open ring that carries plan.shrink settings for a closing storm. |
hazardLanes | Three lane strips that carry plan.lanes settings for burning in turn. |
Every layout has an outer ring wall of 24 segments with four openings, eight spawn gates just inside it (<prefix>Gate1..8, group <prefix>Gates) and four player starts near the centre (<prefix>Start1..4).
API
Arenas.plan(id, { radius = 20, prefix = "", gates = 8, segments = 24 })returns a plan:{ id, radius, prefix, pieces, shrink?, lanes? }. Pure data, no engine calls, so it is safe in tests, on a server and in tools.Arenas.build(id, { center, radius, theme, parent, prefix, gates, spawnPoints = true })spawns it and returnsroot, plan. The root is<prefix>Arena.Arenas.ids(),Arenas.describe(id),Arenas.count(plan)list and inspect layouts.Arenas.defineLayout(id, { label, description, tags }, fill)adds a layout:fill(pieces, plan, radius)appends pieces.Arenas.defineTheme(name, { label, floor, wall, pillar, bunker, lane, dressing })registers a look;Arenas.themeNames()lists them.Arenas.use({ spawner = require("spawnerKit.api"), materials = { sandPacked = ..., stoneAshlar = ..., tileGlazed = ..., mudBrick = ..., sandstonePale = ..., sandRed = ... } })hands in optional kits: with a spawner the gates become spawn points; the materials dress thedesertRuinstheme. Nothing is looked up on its own, so the package works and publishes in any world.Arenas.propHook = function(entity, kind, seed, scale) ... return true endlets your own prop kit place ruins (ruinWallStone,ruinColumn,ruinHouse,palmDate, ...) in thedesertRuinstheme; return false to fall back to shapes.Arenas.withDefaults({ prefix = "TS" })returns a view whoseplanandbuilduse those defaults, which is how a game keeps its own entity names.
Themes
plain: engine cubes and a checkerboard floor, tinted stone colours. Works in any world.desertRuins(the default): sand, ashlar, glazed tile and mud brick surfaces handed in withuse({ materials = ... })(desertMaterials has them; checkerboard otherwise), with props throughpropHook.
Pairs well with
- arenaHazardsKit runs the storm of
shrinkingand the burning lanes ofhazardLanes. - spawnerKit turns the gates into spawn points for waves of enemies once handed in with
Arenas.use({ spawner = require("spawnerKit.api") }).
The test suite arenaLayoutKit checks every layout's plan and builds each one in edit mode.