Modify a text file: $/p1x227Olverapt3.pde
$/p1x227Olverapt3.pde
//Project #1 example //J.O.P //Declare vars. for ball float bx; //X pos. of ball float by; //Y pos. of ball float bSize; //Ball size float xSpeed; //Horizontal speed float ySpeed; //Vertical speed void setup() { size(500, 500); //Initialize variables for ball bx = width/2; by = height/2; bSize = width/5.5; xSpeed = 2; ySpeed = 3; } void draw() { background(0, 0, 0); //Draw ellipse stroke(random(255)); textSize(15, 15); text("Time Circle", bx - 41, by + 5); ellipse ( bx, by, bSize, bSize); //Ellipse's horizontal movement bx += xSpeed; //Ellipse's Vertical movement by += ySpeed; //Make ellipse reverse course for 'X' position if(bx >= width - bSize/2 || bx <= 0 + bSize/2){ xSpeed *= -1; //Movement of 'X' is reversed fill(random(255), random(255), random(255), random(255)); //Ellipse changes color randomly for 'X' pos. } //Make ellipse reverse course for 'Y' position if (by >= height - bSize/2 || by <= 0 + bSize/2){ ySpeed *= -1; //Movement of 'Y' is reversed fill(random(255), random(255), random(255), random(255)); //Ellipse changes color randomly for 'Y' pos. } textSize(20, 20); //Text size for all texts text("Jose Jalapeņo", 5, 17); text("Will it hit the corner?...", 50, 100); //Questioning text("Decide when it'll reach it...", 240, 270); //Comment text("Choose wisely...", 100, 400); //Comment } void textSize( float arg1, float arg2 ) { // Ignore arg2 textSize(arg1); }