use of com.almasb.fxgl.dsl.components.RandomAStarMoveComponent in project FXGL by AlmasB.
the class RandomPathfindingSample method spawnNPC.
private void spawnNPC(int x, int y) {
var e = entityBuilder().viewWithBBox(new Rectangle(20, 20, FXGLMath.randomColor())).anchorFromCenter().with(new CellMoveComponent(CELL_WIDTH, CELL_HEIGHT, 150)).with(new AStarMoveComponent(grid)).with(new RandomAStarMoveComponent(1, 7, Duration.seconds(1), Duration.seconds(3))).buildAndAttach();
e.getComponent(AStarMoveComponent.class).stopMovementAt(x, y);
}
Aggregations