flix

0.81.0

Animation

Definitions

def fieldHeight(): Float32§ Source

The height of the animation canvas as a Float32 for geometric calculations.

def fieldHeightPx(): Int32§ Source

The height of the animation canvas in pixels.

def fieldWidth(): Float32§ Source

The width of the animation canvas as a Float32 for geometric calculations.

def fieldWidthPx(): Int32§ Source

The field the balls bounce in, which is also the window main opens.

One pair of numbers: the walls, the window and the tests all read them here, so a The width of the animation canvas in pixels.

def initial(seed: Int64): Bouncing§ Source

The starting world: four balls from seed, and nothing being pushed yet.

The same seed gives the same four balls, so a run of this sketch can be repeated exactly -- the reason the tests can assert about it at all.

def main(): Unit \ IO§ Source

Entry point for running the standalone animation sketch.

def step(world: Bouncing, snapshot: Snapshot): Bouncing§ Source

One logical tick. Pure: no clock, no window, no IO.

def view(world: Bouncing): Unit \ Canvas§ Source

Describes the frame. Uses only Canvas, so a test can record it without a display.