Skip to content

Instantly share code, notes, and snippets.

@lidangzzz
Created November 10, 2020 16:23
Show Gist options
  • Save lidangzzz/05a87904c07915564d52b9a6c9f20f5e to your computer and use it in GitHub Desktop.
Save lidangzzz/05a87904c07915564d52b9a6c9f20f5e to your computer and use it in GitHub Desktop.
export const name = 'square';
export function draw(ctx, length, x, y, color) {
ctx.fillStyle = color;
ctx.fillRect(x, y, length, length);
return {
length: length,
x: x,
y: y,
color: color
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment