-
-
Notifications
You must be signed in to change notification settings - Fork 0
JSGL Template
Tymon Woźniak edited this page Apr 14, 2023
·
1 revision
const grid = new JSGL.Vector2(10, 10);
const backgroundColor = 'black';
const canvasScale = 1;
const game = JSGL.DefaultGame.Create({ grid: grid}, { backgroundColor: backgroundColor }, canvasScale);
const onGameLoaded = () => {
JSGL.log("Game loaded!");
// ^^^^^^^^ logs to console
};
game.LoadGameAndStart().then(() => {
// Game loaded
onGameLoaded();
}).catch((error) => {
// Encountered error while loading
}).finally(() => {
// After operation
});