File size: 635 Bytes
65567a2
 
 
 
 
 
21a57cd
 
 
 
 
 
 
65567a2
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
export const base = {
	default: `/** CHANGELOG
 * v1.0.0. Set up canvas
 */
const canvas = document.querySelector('canvas');
const ctx = canvas.getContext('2d');
/**
 * Always use this random function
 */
function random() {
	return Math.random()
}
/**
 * The draw function is called every frame to update the canvas.
 * To change the drawing logic, modify the code inside this function.
 */
function draw(){
	// TODO: Add drawing logic here
	// Set the desired FPS (frames per second) for the animation
	const FPS = 60;
	// Schedule the next frame to be drawn
	setTimeout(requestAnimationFrame(draw),1000/FPS)
}
draw();
	`.trim(),
};