Skip to content

Instantly share code, notes, and snippets.

@melcor76
Created November 19, 2019 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melcor76/baa0ce851148b5135f88e0f4c7667fd3 to your computer and use it in GitHub Desktop.
Save melcor76/baa0ce851148b5135f88e0f4c7667fd3 to your computer and use it in GitHub Desktop.
js-tetris - draw board
drawBoard() {
this.grid.forEach((row, y) => {
row.forEach((value, x) => {
if (value > 0) {
this.ctx.fillStyle = COLORS[value];
this.ctx.fillRect(x, y, 1, 1);
}
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment