Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: TriggerSequenceMiniGame

[16:7] extends: MiniGame

Wraps FXGL's TriggerSequenceMiniGame (com.almasb.fxgl.minigames.triggersequence.TriggerSequenceMiniGame), a minigame in which a sequence of KeyTriggers scrolls horizontally past two reference lines; the player must press each trigger while it is between the lines. The minigame succeeds when the fraction of correct presses meets or exceeds winRatio.

Methods

  • TriggerSequenceMiniGame (WinRatio = null)

    Creates a new TriggerSequenceMiniGame with the given win ratio. Pass null for the adopt path.

    • @p WinRatio is a double in [0, 1].
  • adopt (object Ajo)

    Wraps an existing TriggerSequenceMiniGame AussomJavaObject.

    • @p Ajo is an AussomJavaObject around a TriggerSequenceMiniGame.
    • @r A new wrapper.
  • getWinRatio ()

    Returns the win ratio. @r A double.

  • getNumTriggers ()

    Returns the minigame's count of triggers. @r An int.

  • getNumTriggersForSuccess ()

    Returns the number of correct triggers needed for success. @r An int.

  • setNumTriggersForSuccess (int N)

    Sets the number of triggers needed for success.

    • @p N is the new count.
    • @r this object
  • getMoveSpeed ()

    Returns the trigger move speed in pixels / second. @r An int.

  • setMoveSpeed (int Speed)

    Sets the trigger move speed.

    • @p Speed is the new speed in pixels / second.
    • @r this object
  • getTriggers ()

    Returns the ArrayList of KeyTrigger objects. Mutate directly to add triggers before the minigame starts.

    • @r An AussomJavaObject around an ArrayList.
  • getViews ()

    Returns the ArrayList of TriggerView render nodes.

    • @r An AussomJavaObject around an ArrayList.
  • endGame (int NumCorrectTriggers)

    Ends the minigame with the supplied count of correct triggers, computing success against winRatio.

    • @p NumCorrectTriggers is the count of correct presses.
    • @r this object
  • isCorrect (object KeyCodeObj, int CurrentIndex)

    Returns whether the given KeyCode matches the trigger at the given index.

    • @p KeyCodeObj is an AussomJavaObject around a KeyCode.
    • @p CurrentIndex is the trigger index in the sequence.
    • @r A bool.