//posicion, velocidad y tamaño ArrayList ps = new ArrayList(); ArrayList vs = new ArrayList(); int sz = 15; void setup() { size(500, 200); } void draw() { //dibujamos el fondo colorMode(RGB, width); for (int i=0;iwidth)) { v.x *= -1; } if ((p.y<0)||(p.y>height)) { v.y *= -1; } }//fin loop actualización if (mousePressed) { PVector p = new PVector (mouseX, mouseY); ps.add(p); PVector v = new PVector(random(2, 6), random(2, 6)); vs.add(v); } } void keyPressed() { if (key=='c') { ps.clear(); vs.clear(); } }