Friday 26 October 2012
//angry monkey hack exercise chris 23/12/4
//declare variables
float y1 = 60;
float y2 = 60;
float y3 = 57;
float y4 = 57;
void setup ()
{
size(450, 280); //window size
smooth(); //anti-alias curves
}
void draw ()
{
fill(219,160,31);
strokeWeight(15); // stroke for ears
background(77,31,219);
if (y1 <200) //animation loop for right ear
{
y1 = y1+1;
}
ellipse(50, y1, 78, 82); //right ear
if (y2>200) //animation loop for left ear
{
y2 = y2-1;
}
ellipse(400, y2, 78, 82); //left ear
strokeWeight(80); //stroke for eyes
fill(245,82,27);//fill colour for eyes using RGB values
if (y3>200) //animation loop for left eye
{
y3 = y3-1;
}
ellipse(300, y3, 95, 100); //left eye
if (y4<200) //animation loop for right eye
{
y4 = y4+1;
}
ellipse(150, y4, 95, 100); //right eye
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment