Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: RandomAStarMoveComponent

[16:7] extends: Component

Wraps FXGL's RandomAStarMoveComponent (com.almasb.fxgl.dsl.components.RandomAStarMoveComponent), which pseudo-randomly walks the entity over an A* grid using the entity's AStarMoveComponent. Requires an AStarMoveComponent on the same entity.

Methods

  • RandomAStarMoveComponent (int MinDistance = 0, int MaxDistance = 2147483647, double MinDelaySeconds = 1.0, double MaxDelaySeconds = 1.0)

    Creates a new RandomAStarMoveComponent.

    • @p MinDistance is the minimum cell distance to move (default 0; possible to not move at all).
    • @p MaxDistance is the maximum cell distance to move (default unlimited).
    • @p MinDelaySeconds is the minimum delay between moves.
    • @p MaxDelaySeconds is the maximum delay between moves.
  • adopt (object Ajo)

    Wraps an existing RandomAStarMoveComponent AussomJavaObject.

  • getMinDistance ()

  • setMinDistance (int V)

  • getMaxDistance ()

  • setMaxDistance (int V)

  • getMinDelay ()

    Returns the min-delay Duration AJO.

  • setMinDelay (double Seconds)

    Sets the minimum delay between moves.

    • @p Seconds is the delay in seconds.
    • @r this object
  • getMaxDelay ()

    Returns the max-delay Duration AJO.

  • setMaxDelay (double Seconds)

    Sets the maximum delay between moves.

    • @p Seconds is the delay in seconds.
    • @r this object
  • getCellFilter ()

    Returns the cell-filter Predicate AJO. Defaults to an always-true predicate; setCellFilter replaces it.

    • @r An AussomJavaObject around a Predicate.
  • setCellFilter (callback Cb)

    Sets a Predicate filter over AStarCells. Only cells that pass the predicate are eligible move targets.

    • @p Cb is a callback (cell) -> bool.
    • @r this object