import { createLike, createStartScreen } from 'like';import { createGameScene } from './game';// init LIKE with scenesconst container = document.getElementById("myGame");const like = createLike(container);const sceneMan = new SceneManager(like);// these callbacks will be ignored until the scene is clickedlike.update = function () { ... }like.draw = function () { ... }// Set up the start screenlike.start();sceneMan.push(startScreen()) Copy
import { createLike, createStartScreen } from 'like';import { createGameScene } from './game';// init LIKE with scenesconst container = document.getElementById("myGame");const like = createLike(container);const sceneMan = new SceneManager(like);// these callbacks will be ignored until the scene is clickedlike.update = function () { ... }like.draw = function () { ... }// Set up the start screenlike.start();sceneMan.push(startScreen())
Alternatively, copy-paste this code into your own project and modify it freely.
Pass a custom draw function to replace the default logo:
const startup = startScreen((like) => { like.gfx.clear([0, 0, 0, 1]); like.gfx.print([1, 1, 1], 'Click to Start', [100, 100]);}); Copy
const startup = startScreen((like) => { like.gfx.clear([0, 0, 0, 1]); like.gfx.print([1, 1, 1], 'Click to Start', [100, 100]);});
Why
Usage
Alternatively, copy-paste this code into your own project and modify it freely.
Custom Rendering
Pass a custom draw function to replace the default logo: