// Declare the image and the x- and y-coordinate variables
PImage back;
int x, y;
int myRed = 200;
int myGreen = 20;
int myBlue = 20;
void setup()
{
// Initialize the output window size and set stroke to smooth;
size(400, 400);
smooth();
// Load the background image
back = loadImage("green1.JPG");
x= width/2;
y= height/2;
//my colors
}
void draw()
{
// Clear the background to the angry birds image
background(back);
//draw the bird
//tail
noStroke();
fill(0);
quad(x-210, y-210, x-270, y-197, x-265, y-210, x-220, y-190);
quad(x-190, y-212, x-275, y-192, x-277, y-182, x-200, y-212);
quad(x-190, y-220, x-265, y-183, x-260, y-175, x-195, y-220);
//head
stroke(0);
strokeWeight(3);
fill(myRed, myGreen, myBlue);
beginShape();
curveVertex(x-300, y-200);
curveVertex(x-190, y-240);
curveVertex(x-250, y-250);
curveVertex(x-100, y-100);
endShape(CLOSE);
beginShape();
curveVertex(x-300, y-230);
curveVertex(x-200, y-240);
curveVertex(x-235, y-265);
curveVertex(x-300, y-110);
endShape(CLOSE);
ellipse(x-205, y-205, 100, 100);
//dark dots on the body
noStroke();
fill(myRed-33,myGreen-6,myGreen-6);
ellipse(x-210,y-205,20,30);
ellipse(x-168,y-200,20,30);
ellipse(x-225,y-195,10,20);
ellipse(x-235,y-185,10,10);
//tan part on the body
noStroke();
fill(myRed+34, myGreen+166, myBlue+117);
arc(x-195, y-153, 80, 80, radians(192), radians(328));
noFill();
stroke(0);
ellipse(x-205, y-205, 100, 100);
noStroke();
fill(myRed, myGreen, myBlue);
rect(x-230, y-256, 27, 20);
//left eye
stroke(0);
fill(255);
ellipse(x-195,y-204,23,23);
fill(0);
ellipse(x-191,y-204,5,5);
//left eyebrow
quad(x-185, y-215, x-215, y-220, x-215, y-213, x-185, y-210);
//right eye
fill(255);
ellipse(x-173,y-204,23,23);
fill(0);
ellipse(x-178,y-204,5,5);
//right eyebrow
quad(x-185, y-215, x-160, y-220, x-160, y-213, x-185, y-210);
//peak
fill(myRed+55, myGreen+176, myBlue-20);
strokeWeight(2);
stroke(0);
triangle(x-185, y-170, x-170, y-185, x-200, y-185);
fill(myRed+55, myGreen+200, myBlue-20);
beginShape();
curveVertex(x-140, y-20);
curveVertex(x-165, y-185);
curveVertex(x-205,y-185);
curveVertex(x-200, y-185);
curveVertex(x-200, y-185);
curveVertex(x-220,y-185);
endShape(CLOSE);
noStroke();
fill(myRed+34, myGreen+166, myBlue+117);
rect(x-210,y-190,10,10);
//move the bird
x=x+1;
y=y+1;
}
void keyPressed()
{
}
void mousePressed()
{
myRed = myRed-10;
myGreen = myGreen-10;
myBlue = myBlue-10;
}
This is all my code, i just need to change its direction with key press but i dont know how,
I'm kinda amature in this so the baloon example has a lot of codes that i havent learndd yet
Thank