float x=random(0,100); float y=random(0,100); float vx = random(1,3); float vy = random(1,3); void setup() { size(100,100); frameRate(25); } void draw() { vx = (mouseX - x) / 30; vy = (mouseY - y) / 30; background(255); fill(0,0,255); float angle = atan2(mouseY-y, mouseX-x); translate(x,y); rotate(angle); triangle( -10,5, 10, 0, -10, -5); x=x+vx; y=y+vy; }