円でマウスを追いかける
/** * Mouse Followers * * @author aa_debdeb * @date 2016/01/18 */ ArrayList<PVector> pastMouses; void setup(){ size(500, 500); smooth(); frameRate(30); pastMouses = new ArrayList<PVector>(); } void draw(){ background(128, 11, 35); stroke(230, 195, 0); strokeWeight(2); fill(255, 15); pastMouses.add(new PVector(mouseX, mouseY)); for(int i = 0; i < pastMouses.size(); i++){ PVector mouse = pastMouses.get(i); float diameter = map(sq(i), 0, 10000, 1, 200); ellipse(mouse.x, mouse.y, diameter, diameter); } if(pastMouses.size() >= 100){ pastMouses.remove(0); } }