-
-
Save BrentAureli/91f39fa4730073ab0005681de62ed83b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function drawGrid(){ | |
for (var i = 0; i < cols; i++) { | |
for (var j = 0; j < rows; j++) { | |
grid[i][j].draw() //grid is a 2D array of nodes | |
} | |
} | |
} | |
//inside node class | |
draw(){ | |
if(this.active) | |
fill(255, 0, 0) | |
else | |
fill(255) | |
rect(this.x * this.size, this.y * this.size, this.size, this.size) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment