Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: RandomOccurrenceMiniGame

[15:7] extends: MiniGame

Wraps FXGL's RandomOccurrenceMiniGame (com.almasb.fxgl.minigames.randomoccurrence.RandomOccurrenceMiniGame), a minigame that races a successFill bar against a failureFill bar; each tick a coin weighted by successChance picks which bar to grow. The first bar to reach 1.0 wins.

Methods

  • RandomOccurrenceMiniGame ()

    Creates a new RandomOccurrenceMiniGame. Defaults match FXGL's source: 0.5 success chance, 0.01 max fill per tick.

  • adopt (object Ajo)

    Wraps an existing RandomOccurrenceMiniGame AussomJavaObject.

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

    Returns the success chance per tick (0..1). @r A double.

  • setSuccessChance (double Chance)

    Sets the success chance per tick.

    • @p Chance is a double in [0, 1].
    • @r this object
  • getMaxSuccessFill ()

    Returns the success-fill cap per tick. @r A double.

  • setMaxSuccessFill (double Cap)

    Sets the success-fill cap per tick. @r this object

  • getMaxFailureFill ()

    Returns the failure-fill cap per tick. @r A double.

  • setMaxFailureFill (double Cap)

    Sets the failure-fill cap per tick. @r this object

  • getSuccessFill ()

    Returns the success-fill DoubleProperty (0..1) for binding to a UI bar.

    • @r An AussomJavaObject around a DoubleProperty.
  • getFailureFill ()

    Returns the failure-fill DoubleProperty (0..1) for binding.

    • @r An AussomJavaObject around a DoubleProperty.