xxxxxxxxxx
36
var bird; // // Declare the var
var gridSize = 280; // Size of each grid item
var numRows = 6; // Number of rows
var numCols = 6; // Number of columns
function setup() {
createCanvas(820, 820);
}
function draw() {
background(250);
var offsetX = 40; // Slide to the right
for (var i = 0; i < numRows; i++) {
for (var j = 0; j < numCols; j++) {
var gx = j * gridSize + offsetX;
var gy = i * gridSize;
// Instantiate a new Bird object
bird = new Bird(gx, gy);
bird.display();
}
}
noLoop(); // Disable loop, otherwise the program causes memory leak and gets slow-down.
}
function keyPressed() {
if (key === 's') {
saveCanvas("week2-assignment-keremyaslıçimen.jpg");
}
}