import Logger from "../utils/Logger.js"; import GameManager from "./GameManager.js"; var stage, provider; function init(options) { Logger.log("Starting StarGazer game", "Game"); stage = options.canvas; GameManager.init(stage); GameManager.start(); provider = options.gazeDataProvider; provider.addEventListener("dataavailable", onGazeUpdate); } function onGazeUpdate(event) { let gazePoint = event.data; gazePoint.linkTo(stage); if (gazePoint.hasLink) { GameManager.addGazePoint(gazePoint); } } export default { init: init, };