JSFiddle - React, Tailwind, and code Playground

by Lloyd Atkinson

HTML

<canvas id="canvas" width="640" height="480"></canvas>

JavaScript

const canvas = document.getElementById('canvas');
const context = canvas.getContext('2d');

context.fillStyle = "black";
context.fillRect(0, 0, canvas.width, canvas.height);

const getRandomNumber = (minimum, maximum) =>
	Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;

const gravity = 0.01;

const update = () => {
	
	
    
	requestAnimationFrame(update);
};

requestAnimationFrame(update);