Mover[] movers = new Mover[30]; PFont f; void setup() { size(640, 360); background(255); for (int i = 0; i < movers.length; i++) { movers[i] = new Mover(); } f = createFont("sans-serif", 36); textFont(f); frameRate(30); mouseX = width/2; mouseY = height/2; } void draw() { background(255); for (int i = 0; i < movers.length; i++) { movers[i].update(); movers[i].checkEdges(); movers[i].display(); } } class Mover { PVector location; PVector velocity; PVector acceleration; float topspeed; String[] ideas = { "i", "d", "e", "a", "i", "d", "id", "did", "die", "dee", "da", "s", "is" }; String ima; Mover() { location = new PVector(random(width), random(height)); velocity = new PVector(0, 0); topspeed = 10; ima = ideas[int(random(ideas.length))]; } void update() { PVector mouse = new PVector(mouseX, mouseY); PVector dir = PVector.sub(mouse, location); dir.normalize(); dir.mult(0.5); acceleration = dir; velocity.add(acceleration); velocity.limit(topspeed); location.add(velocity); } void display() { fill(0, 150); text(ima, location.x, location.y); } void checkEdges() { if (location.x > width) { location.x = 0; } else if (location.x < 0) { location.x = width; } if (location.y > height) { location.y = 0; } else if (location.y < 0) { location.y = height; } } }