setup()
setup() runs once when the sketch starts. Here we initialize the canvas size and pre-define colors so we don't recreate them every frame, which is more efficient.
function setup(){
createCanvas(windowWidth,windowHeight);
sky=color(180,220,255);grass=color(90,180,90);
}
Line by Line:
createCanvas(windowWidth,windowHeight)- Creates a canvas that fills the entire browser window, making the sketch responsive to window size
sky=color(180,220,255)- Creates a light blue color and stores it in the sky variable for the gradient background
grass=color(90,180,90)- Creates a green color and stores it in the grass variable for the lower part of the gradient