IndigoGame
A trait representing a game with scene management baked in
Type parameters
- BootData
-
The class type representing you a successful game boot up
- Model
-
The class type representing your game's model
- StartUpData
-
The class type representing your successful startup data
- ViewModel
-
The class type representing your game's view model
Attributes
- Example
-
object MyGame extends IndigoGame[BootData, StartUpData, Model, ViewModel]
- Graph
-
- Supertypes
- Known subtypes
-
class MyAwesomeGame
Members list
Value members
Abstract methods
boot
provides the initial boot up function for your game, accepting commandline-like arguments and allowing you to declare pre-requist assets assets and data that must be in place for your game to get going.
boot
provides the initial boot up function for your game, accepting commandline-like arguments and allowing you to declare pre-requist assets assets and data that must be in place for your game to get going.
Value parameters
- flags
-
A simply key-value object/map passed in during initial boot.
Attributes
- Returns
-
Bootup data consisting of a custom data type, animations, subsytems, assets, fonts, and the game's config.
Event filters represent a mapping from events to possible events, and act like a firewall to prevent unnecessary event processing by the model or view model.
Event filters represent a mapping from events to possible events, and act like a firewall to prevent unnecessary event processing by the model or view model.
Attributes
Set up of your initial model state
Set up of your initial model state
Value parameters
- startupData
-
Access to Startup data in case you need it for the model
Attributes
- Returns
-
An instance of your game model
Optional name of the first scene. If None is provided then the first scene is the head of the scenes list.
Optional name of the first scene. If None is provided then the first scene is the head of the scenes list.
Value parameters
- bootData
-
Data created during initial game boot.
Attributes
- Returns
-
Optionally return the scene to start the game on, otherwise the first scene is used.
Set up of your initial view model state
Set up of your initial view model state
Value parameters
- startupData
-
Access to Startup data in case you need it for the view model
Attributes
- Returns
-
An instance of your game's view model
A pure function for presenting your game. The result is a side effect free declaration of what you intend to be presented to the player next.
A pure function for presenting your game. The result is a side effect free declaration of what you intend to be presented to the player next.
Value parameters
- context
-
The context the frame should be produced in, including the time, input state, a dice instance, the state of the inputs, and a read only reference to your start up data.
- model
-
The latest version of the model to read from.
- viewModel
-
The latest version of the view model to read from.
Attributes
- Returns
-
A function that produces a description of what to present next, and encapsuates failures or resulting events within the Outcome wrapper.
A non-empty ordered list of scenes
A non-empty ordered list of scenes
Value parameters
- bootData
-
Data created during initial game boot.
Attributes
- Returns
-
A list of scenes that ensures at least one scene exists.
The setup
function is your only opportunity to do an initial work to set up your game. For example, perhaps one of your assets was a JSON description of a map or an animation sequence, you could process that now, which is why you have access to the AssetCollection
object. setup
is typically only called when new assets are loaded. In a simple game this may only be once, but if assets are dynamically loaded, set up will be called again.
The setup
function is your only opportunity to do an initial work to set up your game. For example, perhaps one of your assets was a JSON description of a map or an animation sequence, you could process that now, which is why you have access to the AssetCollection
object. setup
is typically only called when new assets are loaded. In a simple game this may only be once, but if assets are dynamically loaded, set up will be called again.
Value parameters
- assetCollection
-
Access to the Asset collection in order to, for example, parse text files.
- bootData
-
Data created during initial game boot.
- dice
-
Psuedorandom number generator
Attributes
- Returns
-
Return start up data, which can include animations and fonts that could not be declared at boot time.
A pure function for updating your game's model in the context of the running frame and the events acting upon it.
A pure function for updating your game's model in the context of the running frame and the events acting upon it.
Value parameters
- context
-
The context the frame should be produced in, including the time, input state, a dice instance, the state of the inputs, and a read only reference to your start up data.
- model
-
The latest version of the model to read from.
Attributes
- Returns
-
A function that maps GlobalEvent's to the next version of your model, and encapsuates failures or resulting events within the Outcome wrapper.
A pure function for updating your game's view model in the context of the running frame and the events acting upon it.
A pure function for updating your game's view model in the context of the running frame and the events acting upon it.
Value parameters
- context
-
The context the frame should be produced in, including the time, input state, a dice instance, the state of the inputs, and a read only reference to your start up data.
- model
-
The latest version of the model to read from.
- viewModel
-
The latest version of the view model to read from.
Attributes
- Returns
-
A function that maps GlobalEvent's to the next version of your view model, and encapsuates failures or resulting events within the Outcome wrapper.
Concrete methods
Inherited methods
Attributes
- Inherited from:
- GameLauncher
Attributes
- Inherited from:
- GameLauncher
Attributes
- Inherited from:
- GameLauncher
Attributes
- Inherited from:
- GameLauncher
Attributes
- Inherited from:
- GameLauncher
Attributes
- Inherited from:
- GameLauncher
Attributes
- Inherited from:
- GameLauncher
Attributes
- Inherited from:
- GameLauncher
Attributes
- Inherited from:
- GameLauncher