Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: RandomMoveComponent

[16:7] extends: Component

Wraps FXGL's RandomMoveComponent (com.almasb.fxgl.dsl.components.RandomMoveComponent), which pseudo-randomly walks the entity within a Rectangle2D bounds region. When the bbox approaches the edge the move direction reverses toward the center of the bounds.

Methods

  • RandomMoveComponent (double MinX = 0.0, double MinY = 0.0, double Width = 100.0, double Height = 100.0, double MoveSpeed = 50.0)

    Creates a new RandomMoveComponent.

    • @p MinX is the bounds left edge.
    • @p MinY is the bounds top edge.
    • @p Width is the bounds width.
    • @p Height is the bounds height.
    • @p MoveSpeed is the per-tick move speed.
  • adopt (object Ajo)

    Wraps an existing RandomMoveComponent AussomJavaObject.

  • getBounds ()

    Returns the bounds Rectangle2D AJO.

  • setBounds (double MinX, double MinY, double Width, double Height)

    Sets the bounds rectangle.

    • @r this object
  • getMoveSpeed ()

  • setMoveSpeed (double V)

  • getTx ()

  • setTx (double V)

  • isRotating ()

  • setRotating (bool V)

  • getVelocity ()

    Returns the velocity Vec2 AJO.

  • getDirectionAngle ()

  • setDirectionAngle (double V)

  • withoutRotation ()

    Disables entity auto-rotation as it moves.