• fullscreen
  • Sable.pde
  • TP_2Carl.pde
  • class Sable {
      float x,y,v,r;
      Sable(float x_, float y_, float r_){
        x = x_;
        y = y_;
        v = 17;
        r = r_;
      void update(){
        float distance = dist(mouseX,mouseY,x,y);
        if (distance < 14 ){
          if (mousePressed){
            float radians = atan2(mouseY-y,mouseX-x)+PI;
            x = x + v * cos(radians);
            y = y + v * sin(radians);
        x = constrain (x,r/2,width-r/2);
        y = constrain(y,r/2,height-r/2);
    Sable sable;
    ArrayList sables;
    void setup() {
      sables = new ArrayList();
      for (int i = 0; i < 10000; i++) {
        sables.add(new Sable (random(width),random(height),0.5));
    void draw() {
      background (162,158,26);
      for ( int i = 0 ; i < sables.size(); i ++){
        Sable sable = (Sable) sables.get(i);


    tweaks (0)

    about this sketch

    This sketch is running as Java applet, exported from Processing.



    Report Sketch

    Report for inappropriate content

    Please provide details if possible:

    Your have successfully reported the sketch. Thank you very much for helping to keep OpenProcessing clean and tidy :)

    Make a Copyright Infringement claim

    Carl Beaumier

    Sand Painting

    Add to Faves Me Likey@!
    You must login/register to add this sketch to your favorites.

    Hey hi again !

    This is a little something to paint. it is like if you're painting into the sand ! Hold the mouse button to draw.

    If someone know how I should implement a code to restart the skecth when the user press a key, plz answer me ! THX


    21 Feb 2010
    Hi, i didn't tried it, but it might work:

    void keyPressed() { setup(); }
    Carl Beaumier
    22 Feb 2010
    No, it doesn't. Or...whereshould I put it in the code. thx
    21 Mar 2010
    put it after the whole draw-thing - at the end of your sketch. May need some refinement though.

    You need to login/register to comment.