Interface IGameStarter
The game starter interface is the interface that a game project should implement so that it can be loaded by the editor. When loading a game from the editor, the editor searches for an implementation of this interface in the game, and calls the "StartGame" method with the game it created so that the editor and the game will have a shared interface to the game.
Namespace: AGS.API
Assembly: AGS.API.dll
Syntax
public interface IGameStarter
Examples
An implementation of the game starter interface will look like this in its most basic form:
public class MyGameStarter : IGameStarter
{
IGameSettings Settings => new AGSGameSettings("My Game", new Size(1280, 800));
public void StartGame(IGame game)
{
game.Events.OnLoad.Subscribe(onGameLoaded); //Here is where you create all of the rooms, characters, etc in the game.
}
}
Properties
| Improve this Doc View SourceSettings
Gets the settings for the game.
Declaration
IGameSettings Settings { get; }
Property Value
Type | Description |
---|---|
IGameSettings | The settings. |
Methods
| Improve this Doc View SourceStartGame(IGame)
Creates the game.
Declaration
void StartGame(IGame game)
Parameters
Type | Name | Description |
---|---|---|
IGame | game |