Path — waypoints and steering
pathdecides where a target should go — follow a route of waypoints, glide a spline, or steer toward a moving goal (seek / flee / arrive) — and emits motion to get it there. Wheremotionplays a fixed, authored path,pathcomputes a dynamic one each tick: patrols, rails, and chasing.
Status: design. Not built yet.
What it is
motion plays a path you wrote down; path works out the path as it goes. Three flavours, all emitting motion or a velocity underneath:
- waypoints — a list of points followed in order,
looporpingpong, with an arrival tolerance (a guard patrol, a conveyor route); - spline — a smooth curve through control points (rails, a swooping camera-less flythrough);
- steering — a goal, not a route: seek a point or a moving target, flee from one, arrive (decelerate into the goal), optionally wander — producing a heading and speed each tick.
path vs motion
motion is data — a fixed sequence, replayed. path is a policy — it reacts to a moving target and the world each tick, so a chaser tracks a fleeing player rather than following a pre-baked line. path sits just above motion: it decides the immediate move and hands it down (a short motion segment, or a direct velocity), so all of motion's transforms and easing still apply.
On the stage
path runs in Advance: it reads the target and its goal (a point, or another target), computes the next move, and drives motion (or writes a velocity). Steering is a pure function of positions, so a patrol or a chase is deterministic and replays exactly.
Clients
- Luau —
require("path"): follow waypoints or a spline, or set a steering goal. - AntBASIC —
PATROL sprite%, route$andSEEK sprite%, target%as the friendly verbs.