MinigameRoot
namespace Griff.Scenes;
public sealed class MinigameRoot : ComponentThe game puts this on the entity a minigame is played in (see Minigame and a trigger’s Play Minigame): what the minigame scene had, under one entity of its own, set beside the rest of the world. While it’s there it has the screen and the player’s input, and pauses the rest of the scene if it says so. Its Win, Lose and Quit actions end it, as a trigger in it does with Win Minigame or Lose Minigame. Kept with the scene, so rewinds and saved games keep the minigame too; you don’t add it yourself.
This is a component: its saved properties are on its component page.
Properties
Section titled “Properties”public bool Ended { get; set; }True once it has ended (it goes at the end of that step).
public float Fade { get; set; }Seconds the screen fades out and in as it ends.
FocusBefore
Section titled “FocusBefore”public IReadOnlyList<string> FocusBefore { get; set; }The ids of the entities that had the player’s input as it opened, given it back as it ends.
public float Left { get; set; }Where its part of the world starts, from the left, in world units: what’s spawned with no parent from there on (a bullet its gun fires) goes into it.
LostMessage
Section titled “LostMessage”public string? LostMessage { get; set; }The message sent as it’s lost.
MusicBefore
Section titled “MusicBefore”public string? MusicBefore { get; set; }The music that was playing as it opened, played again as it ends if the minigame changed it.
OpenedFrom
Section titled “OpenedFrom”public string? OpenedFrom { get; set; }The id of the entity that opened it (its Minigame), or empty.
public int Order { get; set; }Which minigame open came first: the one with the highest has the screen.
PauseBelow
Section titled “PauseBelow”public bool PauseBelow { get; set; }Pauses everything outside it (and the minigames opened after it) while it’s played.
public string? Scene { get; set; }The scene being played.
WonMessage
Section titled “WonMessage”public string? WonMessage { get; set; }The message sent as it’s won.
Methods
Section titled “Methods”IsBehind
Section titled “IsBehind”public static bool IsBehind(Entity entity, Entity? shown)True if entity is out of sight behind the minigame that has the screen (Shown).
public static Entity? Of(Entity? entity)The open minigame entity is in (its root), or null when it’s in none: minigames’ roots are top-level entities, so it’s the top of its hierarchy, if that’s one.
OpenedBy
Section titled “OpenedBy”public static Entity? OpenedBy(Entity? opener)The root of the minigame opener opened that’s being played, or null.
public static Entity? Shown(Scene scene)The minigame that has the screen in scene: the open one opened last, or null while none is. What’s outside it isn’t drawn, and its camera is the main one.
Fields
Section titled “Fields”DefaultLostMessage
Section titled “DefaultLostMessage”public const string DefaultLostMessageThe message sent as a minigame is lost, when nothing else is named.
DefaultWonMessage
Section titled “DefaultWonMessage”public const string DefaultWonMessageThe message sent as a minigame is won, when nothing else is named.