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