//Nanette CST112 //Project 5 float x, y; float sidewalk; int spacing=60; int many=8; String title= "Project 5"; String subtitle= "Press 't' key to move tallest to end."; String author= "Nanette, CST112"; // ARRAY OF PERSONS// Person [] people = new Person [many]; //SETUP: define screen size// void setup() { size (600, 600 ); x = 0; y = 0; sidewalk = height/1.5; //--?? people= new Person (); reset(); } void reset() { for (int i=0; i p[k].tall) { k=j; } } // Move it to end (swap). Person save; save= p[m-1]; p[m-1]= p[k]; p[k]= save; } //CLASS DEFINITIONS/// class Person { float r=255, g=0, b=0; // float x= random ( 50, 350); // float y= random (sidewalk, 250); //--int x= 50; //--int y= 50; int tall= int( random( 50, 150 ) ); int wide= int( random( 15, 45 ) ); // CONSTRUCTOR Person() { r= random( 200 ); g= random( 200 ); b= random( 200 ); } //Display People void show( float x, float y ) { stroke ( 255, 0, 0 ); fill ( r, g, b ); rect ( x, y, wide,-tall ); float hh=tall/6; ellipse( x+wide/2, y-tall-hh/2, hh,hh*3/4 ); } }