Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: OctileDistance

[15:7] extends: DiagonalHeuristic

Wraps FXGL's OctileDistance heuristic (com.almasb.fxgl.pathfinding.heuristic.OctileDistance), the diagonal-aware cost function used by A* in 8-direction mode. Extends DiagonalHeuristic, so it carries both the base weight and the sqrt(2)-weighted diagonal weight.

Methods

  • OctileDistance (int Weight = -1)

    Creates a new OctileDistance heuristic.

    • @p Weight is the base weight (default 10 when -1).
  • adopt (object Ajo)

    Wraps an existing OctileDistance AussomJavaObject.

  • getWeight ()

  • getDiagonalWeight ()

  • getCost (int StartX, int StartY, int TargetX, int TargetY)