Skip to content

Instantly share code, notes, and snippets.

@melcor76
Created November 19, 2019 13:04
Embed
What would you like to do?
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