//Eric Hammond CIS 112 // Sept 13th 2012 Proj 1 //Bird, Man, and Dog int birdX=100, birdY=100; //Global data int birdDX=20; void setup() { size( 800, 600 ); //Visual size of program } void draw() //Calling methods to be used { scene(); dog(); guy(); bird(); } void scene() //Settiing up sun/sky/ground { background( 150, 180, 255 ); fill( 255, 255, 0 ); ellipse( 730, 60, 60, 60 ); fill( 80, 255, 80 ); rectMode( CORNERS); rect( 0, height/3, width, height ); //(?)Credit to Prof. BAM for this line } void bird() //Bird will fly across screen and return to other side upon hitting wall { birdX = birdX + birdDX; birdX = birdX % width; fill( 85, 85, 85 ); triangle( birdX,birdY, birdX-50,birdY-25, birdX-50,birdY+25 ); } void guy() //Man follows mouse movements { fill( 200,220,255 ); rectMode( CENTER ); rect( mouseX, mouseY, 40, 70 ); fill( 229, 209, 208 ); ellipseMode( CENTER ); ellipse( mouseX, mouseY-35-15, 35,35 ); } void dog() //Dog follows behind the man { fill( 170, 70, 80 ); rectMode( CENTER ); rect( pmouseX-60, pmouseY+80, 30, 20 ); rect( pmouseX-40, pmouseY+65, 15, 10 ); }