View Source ECSx.System behaviour (ECSx v0.5.1)

A fragment of game logic which reads and updates Components.

Each System must implement a run/0 function, which will be called once per game tick.

defmodule MyApp.FooSystem do
  @behaviour ECSx.System

  @impl ECSx.System
  def run do
    # System logic
    :ok
  end
end

Link to this section Summary

Callbacks

Invoked to run System logic.

Link to this section Callbacks

@callback run() :: any()

Invoked to run System logic.

This function will be called every game tick.

Note: A crash inside this function will restart the entire app!