Code Architecture

ECS

The ECS "framework" is inside world.fnl.

Screens

The main script allows switching between screens by setting the next field on the world.

These are the possible screens:

Actions

match/state.fnl builds a "state" object which contains just the game state.

match/actions.fnl gives a list of possible actions from a given state.

match/info.fnl provides high-level queries for the data.

match/player.fnl displays a user interface for possible moves.

match/ai.fnl contains AIs which decide which move is best.

User Input

AI

Components

The following components are used:

Title Screen

{:title-screen {:selected 1}}
{:emitter {:delay 0 :emission (fn [] {})}}
{:x :y}
{:card {:owner 1 :kind :virus :open true :border false} :screen-x :screen-y}
{:cell {:start-for 1 :exit-for 2} :circuit-x 1 :circuit-y 1}
{:slot {:owner 1 :icon 12} :x 1 :y 1}
{:match {:phase {:setup true :player 1} :entities []}}