use of com.almasb.fxgl.ai.AIControl in project FXGL by AlmasB.
the class BehaviorSample method initGame.
@Override
protected void initGame() {
player = Entities.builder().at(100, 100).viewFromNode(new Rectangle(40, 40)).with(new PlayerControl()).buildAndAttach(getGameWorld());
playerControl = player.getControl(PlayerControl.class);
Entities.builder().at(400, 100).viewFromNode(new Rectangle(40, 40, Color.RED)).with(new AIControl("patrol.tree")).buildAndAttach(getGameWorld());
Entities.builder().at(600, 100).viewFromNode(new Rectangle(40, 40, Color.LIGHTGOLDENRODYELLOW)).with(new AIControl("patrol.tree")).buildAndAttach(getGameWorld());
}
Aggregations