flix

0.81.0

Session

The layer above the game.

Game.step never learns that any of this exists. This module drives it -- once per real player, or once for the attract-mode bot -- and owns everything a single game does not: screens, player count, whose turn it is.

Definitions

def active(s: Session): World§ Source

The world whose turn it is.

def allDone(s: Session): Bool§ Source

True once every player has finished.

def cabinet(s: Session): Cabinet§ Source

What the HUD needs to know about the other player. The cabinet draws its own endings, so View must not draw one too.

def initial(seed: Int64): Session§ Source

Initializes a fresh cabinet session with default scores and seed.

def nextPlayer(current: Int32, s: Session): Option[Int32]§ Source

The next player still in the game, starting after current and wrapping.

Returns None when nobody is left, which is what ends the session.

def onScreen(s: Session): World§ Source

The world the player is looking at.

The demo only behind the title. Behind the initials prompt it is the game that just ended, which is the whole point of that screen -- showing the attract game there put the demo's score in the HUD beside a banner announcing the player's, so the two blurred into one game with two scores.

def startRequest(input: Snapshot): Option[Int32]§ Source

How many players the keypress asks for, if it asks for a game at all.

def step(s: Session, input: Snapshot): Session \ Sound§ Source

Advances the cabinet session by one tick given user input.

def stillIn(w: World): Bool§ Source

Whether this player still has a game to play.

def togglesNerds(input: Snapshot): Bool§ Source

One tick of the cabinet.

Whether the telemetry overlay is up.

F3, following the convention every game that has one of these uses. It is cabinet state rather than game state: it survives a game ending, and turning it on must not change what the game does -- TestSession holds it to that.

def withScores(seed: Int64, scores: List[Entry]): Session§ Source

A cabinet that already knows some high scores -- what main builds after reading them from disk.

def withTuning(seed: Int64, scores: List[Entry], tuning: Tuning): Session§ Source

The same, with the demo player's numbers supplied.

The cabinet carries them rather than Demo owning them as constants, so a tuning read from a file reaches the attract screen without anything below here knowing where it came from.