NERDDISCO's picture
feat: changed everything to create Canvas2D games
6c2bcb4
raw
history blame
330 Bytes
export const base = {
default: `const canvas = document.querySelector('canvas');
canvas.style.backgroundColor = '#fff';
const ctx = canvas.getContext('2d');
function draw(){
const FPS = 60;
// TODO: Add drawing logic here
// NEVER stop the loop
setTimeout(requestAnimationFrame(draw),1000/FPS)
}
draw();
`.trim(),
};