JSFiddle - React, Tailwind, and code Playground
by frogggeee McFrogggeee
HTML
rightPressed = true;
leftPressed = true;
setTimeout(ghti, 1);
function ghti() {
rightPressed = false;
leftPressed = false;
}
JavaScript
var i = 0;
var thingi = 0;
var orexx = 0;
var oreyy = 0;
ctx.beginPath();
ctx.rect(x, y, 20, 20);
ctx.fillStyle = "#696968";
ctx.fill();
ctx.closePath();
for (i = 0;i < 10;i++) {
orexx = orex[thingi];
oreyy = orey[thingi];
ctx.beginPath();
ctx.rect(x + orexx, y + oreyy, 4, 4);
ctx.fillStyle = " #000000";
ctx.fill();
ctx.closePath();
thingi++;
}