Modify a text file: $/201-brooks.pde
$/201-brooks.pde
//// exercise //// Nbrooks float x,y; // Poition of man void setup() { size( 600, 400 ); x=100; y=100; } // NEXT FRAME //// void draw() { background( 80, 0, 70); fill( 155, 0, 0 ); house(); man(); action(); textSize(26); text( "waah gwaan, peeps", x+200, y+100 ); } void house() { rectMode(CENTER); fill( 0, 0, 0 ); rect( 200, 175, 175, 150 ); fill( 0, 0, 100 ); ellipse( 200, 175, 175, 150 ); stroke( 10, 200, 50 ); line( 100, 75, 200, 175 ); fill( 80, 10, 100 ); triangle( 100, 100, 200, 50, 300, 100 ); } void man() { /// Man fill( 0, 0, 100 ); rectMode(CENTER); // body & head rect(x,y, 20, 100); ellipse(x, y-30, 60, 60); // eyes fill( 0, 255, 0 ); ellipse(x-19, y-30, 16, 32); //-- ellipse(119, 70, 16, 32); ellipse(x+19, y-30, 16, 32); line(90, 150, 80, 160); line(110, 150, 120, 160); } //// Move the man (by changing x,y) void action() { if (x>width) { x=100; y=100; } x= x + 3; y= y + 2; } void mousePressed() { x= mouseX; y= mouseY; }