use of com.almasb.fxgl.entity.control.JSControl in project FXGL by AlmasB.
the class JavaScriptSample method initGame.
@Override
protected void initGame() {
Entities.builder().at(100, 100).viewFromNode(new Rectangle(40, 40)).with(new JSControl("spin_control.js")).buildAndAttach(getGameWorld());
Entities.builder().at(180, 100).viewFromNode(new Rectangle(40, 40)).with(new JSControl("ccw_spin_control.js")).buildAndAttach(getGameWorld());
getAssetLoader().loadScript("sample.js").call("sample");
}