hey again @jb4x, sorry to bother you, but the flying thing is not working out lol so I’m trying to have my bird fly across the screen with its wings flapping, but I cant seem to figure it out.
first I created the two different characters (one with the wings up and the other with the wings down) so I could combine both the create the illusion.
void setup() {
size(500, 500);
background(102, 178, 255);
scale(0.70);
drawBird(0, 0);
drawBird(400, 0);
}
void drawBird(float x, float y) {
pushMatrix();
translate(x, y);
strokeWeight(1.5);
fill(0, 153, 120);
/*Right Leg*/
line( 150, 220, 190, 300);
line( 190, 300, 170, 380);
arc( 176, 380, 20, 18, PI, TWO_PI, CLOSE);
fill(250, 200, 100);
/*body and head*/
arc( 140, 180, 150, 150, 0, PI, CLOSE);
arc( 220, 180, 50, 50, 0, 2*PI, CLOSE);
/*left Leg*/
fill(0, 153, 120);
line( 120, 220, 150, 300);
line( 150, 300, 110, 380);
arc( 118, 380, 20, 18, PI, TWO_PI, CLOSE);
/*eye*/
fill(255);
ellipse( 225, 175, 20, 20);
fill(0, 0, 153);
ellipse( 227, 174, 10, 10);
fill(255);
ellipse( 229, 175, 5, 5);
/*Lashes*/
fill(1);
strokeWeight(2);
line( 220, 165, 218, 160);
line( 226, 165, 226, 158);
line( 232, 166, 235, 162);
/*Beak*/
triangle( 236, 190, 232, 200, 247, 200);
/*Antena*/
noFill();
strokeWeight(1);
arc( 258, 148, 70, 85, 2.95, TWO_PI);
arc( 288, 146, 10, 14, 0, TWO_PI);
/*Tail*/
strokeWeight(1);
fill(255, 153, 153);
triangle( 0, 180, 62, 112, 70, 180);
fill(100, 180, 100);
triangle( 10, 178, 58, 122, 68, 180);
fill(0, 204, 204);
triangle( 18, 176, 56, 132, 68, 180);
fill(255, 170, 51);
triangle( 28, 174, 54, 142, 70, 180);
popMatrix();
/*wing1*/
strokeWeight(1.5);
fill(255, 170, 51);
arc( 150, 190, 80, 70, 0, PI, CLOSE);
strokeWeight(2);
line( 126, 216, 134, 210);
line( 144, 223, 146, 212);
line( 164, 222, 156, 212);
/*wing2*/
strokeWeight(1.5);
fill(255, 170, 51);
arc( 550, 190, 80, 70, PI,TWO_PI,CLOSE);
strokeWeight(2);
line( 558, 170, 568, 160);
line( 548, 170, 550, 156);
line( 540, 170, 532, 158);
}
with this I cant figure out how to add movement, and I keep getting error messages.
so next I just kept the one bird to see if I can get it to move forward, and it worked, but it’s leaving this trail and it’s not going all the way through.
int i = 0;
void setup() {
size(500, 500);
background(102, 178, 255);
}
void draw() {
//line (i,0,i,100);
/*Right Leg*/
line( 150+i, 220, 190+i, 300);
line( 190+i, 300, 170+i, 380);
arc( 176+i, 380, 20, 18, PI, TWO_PI, CLOSE);
fill(250, 200, 100);
/*body and head*/
arc( 140+i, 180, 150, 150, 0, PI, CLOSE);
arc( 220+i, 180, 50, 50, 0, 2*PI, CLOSE);
/*left Leg*/
fill(0, 153, 120);
line( 120+i, 220, 150+i, 300);
line( 150+i, 300, 110+i, 380);
arc( 118+i, 380, 20, 18, PI, TWO_PI, CLOSE);
/*eye*/
fill(255);
ellipse( 225+i, 175, 20, 20);
fill(0, 0, 153);
ellipse( 227+i, 174, 10, 10);
fill(255);
ellipse( 229+i, 175, 5, 5);
/*Lashes*/
fill(1);
strokeWeight(2);
line( 220+i, 165, 218+i, 160);
line( 226+i, 165, 226+i, 158);
line( 232+i, 166, 235+i, 162);
/*Beak*/
triangle( 236+i, 190, 232+i, 200, 247+i, 200);
/*Antena*/
noFill();
strokeWeight(1);
arc( 258+i, 148, 70, 85, 2.95, TWO_PI);
arc( 288+i, 146, 10, 14, 0, TWO_PI);
/*wing*/
strokeWeight(1.5);
fill(255, 170, 51);
arc( 150+i, 190, 80, 70, 0, PI, CLOSE);
strokeWeight(2);
line( 126+i, 216, 134+i, 210);
line( 144+i, 223, 146+i, 212);
line( 164+i, 222, 156+i, 212);
/*Tail*/
strokeWeight(1);
fill(255, 153, 153);
triangle( 0+i, 180, 62+i, 112, 70+i, 180);
fill(100, 180, 100);
triangle( 10+i, 178, 58+i, 122, 68+i, 180);
fill(0, 204, 204);
triangle( 18+i, 176, 56+i, 132, 68+i, 180);
fill(255, 170, 51);
triangle( 28+i, 174, 54+i, 142, 70+i, 180);
strokeWeight(1.5);
fill(0, 153, 120);
/*Right Leg*/
line( 150+i, 220, 190+i, 300);
line( 190+i, 300, 170+i, 380);
arc( 176+i, 380, 20, 18, PI, TWO_PI, CLOSE);
fill(250, 200, 100);
/*body and head*/
arc( 140+i, 180, 150, 150, 0, PI, CLOSE);
arc( 220+i, 180, 50, 50, 0, 2*PI, CLOSE);
/*left Leg*/
fill(0, 153, 120);
line( 120+i, 220, 150+i, 300);
line( 150+i, 300, 110+i, 380);
arc( 118+i, 380, 20, 18, PI, TWO_PI, CLOSE);
/*eye*/
fill(255);
ellipse( 225+i, 175, 20, 20);
fill(0, 0, 153);
ellipse( 227+i, 174, 10, 10);
fill(255);
ellipse( 229+i, 175, 5, 5);
/*Lashes*/
fill(1);
strokeWeight(2);
line( 220+i, 165, 218+i, 160);
line( 226+i, 165, 226+i, 158);
line( 232+i, 166, 235+i, 162);
/*Beak*/
triangle( 236+i, 190, 232+i, 200, 247+i, 200);
/*Antena*/
noFill();
strokeWeight(1);
arc( 258+i, 148, 70, 85, 2.95, TWO_PI);
arc( 288+i, 146, 10, 14, 0, TWO_PI);
/*wing*/
strokeWeight(1.5);
fill(255, 170, 51);
arc( 150+i, 190, 80, 70, 0, PI, CLOSE);
strokeWeight(2);
line( 126+i, 216, 134+i, 210);
line( 144+i, 223, 146+i, 212);
line( 164+i, 222, 156+i, 212);
//rect(i,50,200,50);
i=(i+1)%300;
}
I just started learning so my processing knowledge is pretty minimal, and I can’t seem to find the solutions in the forums, so if you have some pointers, please share. what am I doing wrong? lol