plane
Builds the wind-up toy airliner under an airframe entity, as one child entity per part, each carrying one mesh and no physics of its own.
art.plane — the toy 767
Builds the wind-up toy airliner under an airframe entity, as one child entity per part, each carrying one mesh and no physics of its own.
local PlaneArt = require("game.art.plane")
local rig = PlaneArt.build(airframe)
rig.parts.fuselage -- entity refs, one per part
rig.parts.leftWing -- also rightWing, leftEngine, rightEngine, tail, fin, key
rig.half -- { x, y, z } half extents of the whole toy
rig.partHalf.leftWing -- { x, y, z } half extents of that part on its own
PlaneArt.partNames() -- the seven parts a hit can take off
PlaneArt.clear(airframe)
Each part entity stands at its own place on the toy, so part.position and
part.rotation read as where that piece is in the world — which is what a
shed wing needs when it is copied loose onto the table. rig.partHalf gives
that copy a collider the size of the actual part.
The wind-up key is built alongside the parts but is not one of them: nothing knocks the key off.
What it is made of
| File | Holds |
|---|---|
game/art/planeGeometry | the shape, as numbers — fuselage stations, wing and fin sections, nacelle, key |
game/art/planeTexture | the paint, drawn a pixel at a time into one atlas |
game/art/planeAssets | bake(), which writes the meshes, the atlas and the two materials as assets |
The toy wears one atlas and two materials: toy767_paint for every painted
surface and toy767_metal for the key. Geo.UV names the atlas rectangle each
kind of surface reads, and the texture paints those same rectangles, so the
paint and the geometry cannot drift apart.
Re-run require("game.art.planeAssets").bake() after changing either the shape
or the paint; it re-authors every asset in place, keeping their guids.
Scoped to this part · feeds back into the world's score.