

const scriptsInEvents = {

	async Gameplay_sheet_Event1_Act43(runtime, localVars)
	{
		if (typeof window.bestGliderAPI === 'undefined') {
		    window.bestGliderAPI = new BestGliderAPI();
		    window.bestGliderAPI.init().catch(console.error);
		}
	},

	async Gameplay_sheet_Event154_Act10(runtime, localVars)
	{
		if (!runtime.globalVars.scoreSubmitted && window.bestGliderAPI) {
		    // Set the flag to prevent multiple submissions
		    runtime.globalVars.scoreSubmitted = true;
		    console.log("Submitting score once:", runtime.globalVars.Score);
		    window.bestGliderAPI.submitScore(runtime.globalVars.Score, 1);
		}
	}
};

globalThis.C3.JavaScriptInEvents = scriptsInEvents;
