void setup(){ size(1000, 1000); background(255, 255, 255); println("This is in the setup function!"); fill(180, 0, 0); } float x = 200, y = 0; float vx = 0, vy = 0; float ax = 0, ay = 0; float gravity = 1; Boolean ball_color = true; void draw(){ ax = (mouseX - x) * 0.005; ay = (mouseY - y) * 0.005 + gravity; background(255, 255, 255); if (ball_color){ fill(180, 0, 0); } else { fill(0, 200, 0); } line(x, y, mouseX, mouseY); ellipse(x, y, 100, 100); x += vx; y += vy; vx += ax; vy += ay; vx *= 0.99; vy *= 0.99; if(y > 950){ vy = -vy * .85; y = 950; } } void mouseClicked(){ y = mouseY; x = mouseX; vx = 0; vy = 0; println("Somebody clicked the mouse at " + mouseX + "," + mouseY); } void keyPressed(){ if(key == 't'){ ball_color = !ball_color; } }