ExPilot.Race (ExPilot v0.1.1)

Copy Markdown View Source

Race mode: the map's checkpoints AZ taken in order, a lap at a time.

A ship's race.checkpoint is the next one it must pass; passing the last completes a lap. The race is over for a ship after the map's racelaps.

ExPilot.Race.pass(ship, checkpoints, laps)
ExPilot.Race.pass(ship, checkpoints, laps, reach)

Summary

Functions

The ship after this tick: its next checkpoint, laps and whether it has finished. A checkpoint is passed within reach tiles of its centre.

The order ships stand in: finished first, then by laps and checkpoints passed.

Functions

pass(ship, checkpoints, laps, reach \\ 1.5)

@spec pass(ExPilot.Ship.t(), [{integer(), integer()}], pos_integer(), float()) ::
  ExPilot.Ship.t()

The ship after this tick: its next checkpoint, laps and whether it has finished. A checkpoint is passed within reach tiles of its centre.

standings(ships)

@spec standings([ExPilot.Ship.t()]) :: [ExPilot.Ship.t()]

The order ships stand in: finished first, then by laps and checkpoints passed.