Skip to content

MinigameRoot

The 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.

Each is listed as its key in the scene file and the MCP tools, then its kind of value, its default and what it does.

  • scene: text = null. The scene being played. (Names a scene.) (Field: a name.)
  • openedFrom: text = null. The id of the entity that opened it (its Minigame), or empty. (Plain text: the id of what opened it: the game writes it.) (Field: text.)
  • pauseBelow: true or false = true. Pauses everything outside it (and the minigames opened after it) while it’s played. (Field: on or off.)
  • fade: a number = 0. Seconds the screen fades out and in as it ends. (Field: a number.)
  • wonMessage: text = “Minigame Won”. The message sent as it’s won. (Names a message.) (Field: a name.)
  • lostMessage: text = “Minigame Lost”. The message sent as it’s lost. (Names a message.) (Field: a name.)
  • order: a whole number = 0. Which minigame open came first: the one with the highest has the screen. (Field: a number.)
  • left: a number = 0. 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. (Field: a number.)
  • focusBefore: lines of text: an array of strings, or one string with line breaks = []. The ids of the entities that had the player’s input as it opened, given it back as it ends. (Plain text: the ids of what had the input: the game writes it.) (Field: lines of text.)
  • ended: true or false = false. True once it has ended (it goes at the end of that step). (Field: on or off.)
  • musicBefore: text = null. The music that was playing as it opened, played again as it ends if the minigame changed it. (Plain text: the music playing as it opened: the game writes it.) (Field: text.)

What anything can make it do with no code: a Trigger’s do when its message arrives, a Contraptions Wire’s input as its signal comes on, a script’s Game.Do(entity, “Name”).

  • Win (done with a whole number, its score: a trigger’s with, 0 without one). Wins the minigame, with score (0 takes the minigame’s own score: its first Score output, or its first counter’s count).
  • Lose (done with a whole number, its score: a trigger’s with, 0 without one). Loses the minigame, with score (0 takes the minigame’s own score).
  • Restart. Starts the minigame over.

Scripts use it as MinigameRoot: its methods, events and values that aren’t saved with the scene.