xxxxxxxxxx
41
function setup() {
cnv = createCanvas(800, 80);
angleMode(DEGREES);
}
function draw() {
background(220);
//drawBird(-30, -15, 0.7,"white","blue"); //Eaden
//drawBird(-100, -30, 0.5,"yellow","red"); //Eaden
for(let i =0; i<5;i++){
drawBird((-frameCount-100*1.5*i)%width, -15, 0.7, "white","blue");
}
}
function drawBird(x1, y1, s1,col1,col2) {
push();
translate(x1, y1);
scale(s1);
rotate(sin(frameCount*4)*5);
fill(col1);
triangle(780, 75, 745, 100, 780, 100); //tail
triangle(680, 25, 670, 100, 720, 100); //right wing
ellipse(700, 100, 100, 50); //left wing
triangle(710, 25, 680, 100, 730, 100); //body
ellipse(630, 100, 40); //head
fill("orange");
triangle(600, 100, 620, 100, 620, 110); //beak
fill(col2);
ellipse(630, 90, 10); //eye
pop();
} //Eaden
function keyIsPressed(){
if (key == "s"){
saveGif("800x80",5);
}
if (key =="c"){
saveCanvas(cnv,"MyCanvas.png");
}
}