Modify a text file: $/x206.pde
$/x206.pde
//text// a flower which changes color and size when you keep clicking on the object, and when you press any keyboard button it will move in an opposite direction. //set initial location of a "flower" to left of screen horizontally //and center of screen vertically int myX = 0; int myY = 0; int myRed = 140; int myGreen = 140; int myBlue = 180; float diam = 100; float backgroundColor =255; int speed= 1; void setup() { size(400,400); smooth(); //Erases screen } void draw() { //Erase the screen background(backgroundColor); textSize(15); fill(myRed, myBlue, myGreen); text ("Farah Rashid", 300,50); text( "Farah Rashid", 10,390); //Draw a circle noStroke(); ellipseMode(CENTER); fill(myRed, myGreen, myBlue); ellipse(myX,myY,diam,diam); //small circle fill(255); ellipse(myX+15, myY, 25, 25); //small circle fill(255); ellipse(myX-15, myY, 25, 25); //oval fill(255); ellipse(myX, myY-15, 10,25); //oval fill(255); ellipse(myX, myY+15, 10, 25); myX = myX + speed; myY = myY + speed; //Move the circle to the right by one pixel } void keyPressed() { speed = speed* -1; } void mousePressed() { backgroundColor = (int) random(255) - 10; myRed = (int) random(255); myGreen = (int) random(255); myBlue = (int) random(255); diam = random(70, 150); }