val s = Staging; s.clear val (by, ty, lx, rx) = (-200, 200, -300, 300) def pos(c:net.kogics.kojo.staging.SimpleShape):Point=c.origin+c.offset var l = for (i <- 1 to 30) yield (s.circle(i * 5, random(20) - 10, 2), i * 0.2, i * 0.3) tCanvas.onMouseClick{(x,y)=> s.circle(x,y,100).fill(red) } s.loop { l=for ((c, vx, vy) <- l) yield { c.translate(vx, vy) (c, if(pos(c).x>rx||pos(c).xty||pos(c).y