void setup( ){ size(1000, 1000); background(255, 255, 255); } Boolean roundBall = true; float x = 100, y = 100; float vx = 0, vy = 0; float ax = 0, ay = 0; float gravity = 0.1; void draw(){ ax = (mouseX - x) * 0.005; ay = (mouseY - y) * 0.005 + gravity; background(255, 255,255); fill(200, 0, 0); // stroke(0, 255, 0); // This changes the line and outline colors line(mouseX, mouseY, x, y); // stroke(0, 0, 255); if(roundBall){ ellipse(x, y, 40, 40); } else { rect(x, y, 40, 40); } x += vx; y += vy; vx += ax; vy += ay; vx *= 0.995; vy *= 0.995; } void mousePressed(){ background(255, 255, 255); } void keyPressed(){ if(key == 's'){ roundBall = !roundBall; } }