Question: Draw a character that would fit within a 40×40 pixel box. Once you have this working, use for loops to “tile” the image 100 times on a 400×400 pixel canvas. Hint: can you do this using only 2 for loops?
problem: every time I attempt this program it always fails and I cant make it only with 2 loops, can anyone help me start off the code? It wont let me write my code.
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
for (var x= 0; x <= width; x += 40) {
for (var y= 0; y <= height; y += 40) {
fill(255,0,255);
ellipse(x, y, 25, 25)
}
}
}
I put the for loops together as I cant figure out how to make it so that I only have two loops but have the same out come.