Skip to content

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
});
Clone this wiki locally