ExPilot.Art (ExPilot v0.1.1)

Copy Markdown View Source

Every picture ExPilot draws, as a Cauldron2D.Atlas named :ex_pilot.

ExPilot.Art.install()
ExPilot.Art.ship(nil, heading)      # => {:ship, 0, 17}

Tiles are 16 pixels. Walls, half walls, fuel stations, bases, cannons, wormholes, gravity points, treasures and targets are drawn from pictures; ships are the classic outline at 64 headings in each team's colour; shots, sparks and debris are dots.

Summary

Functions

The atlas as a value, without installing it.

Build the atlas and install it, once per boot.

The art for an item of kind.

The atlas name.

The art for a ship of team at heading.

The art for a ship drawn with its own shipshape, installing the shape's headings into the atlas the first time it is seen. nil or a shape that does not parse draws the default ship.

Functions

build()

@spec build() :: Cauldron2D.Atlas.t()

The atlas as a value, without installing it.

install()

@spec install() :: atom()

Build the atlas and install it, once per boot.

item(kind)

@spec item(atom()) :: {:item, atom()}

The art for an item of kind.

name()

@spec name() :: atom()

The atlas name.

ship(team, heading)

@spec ship(integer() | nil, non_neg_integer()) ::
  {:ship, integer(), non_neg_integer()}

The art for a ship of team at heading.

ship_shape(shape, team, heading)

@spec ship_shape(String.t() | nil, integer() | nil, non_neg_integer()) ::
  {:ship, term(), non_neg_integer()}

The art for a ship drawn with its own shipshape, installing the shape's headings into the atlas the first time it is seen. nil or a shape that does not parse draws the default ship.