• fullscreen
  • candycanepaint.pde
  • int WHITE = 1;
    int RED = 2;
    int curColor;
    void setup(){
      frameRate(30);
      size(250,250);
      strokeWeight(8);
      stroke(255);
      curColor = WHITE;
      clearScreen();
    }
    
    void clearScreen(){
       background(204); 
    }
    
    void draw(){
      //if(frameCount % 2 == 0){
            if(curColor == WHITE){
               curColor = RED;
              stroke(255,0,0); 
            } else {
               curColor = WHITE;
              stroke(255); 
            }
      //}
    }
    
    void keyPressed(){
       if(key == ' '){
          clearScreen();
       } 
    }
    
    
    float x,y;
    void mousePressed(){
        x = mouseX;
        y = mouseY;
    }
    void mouseDragged(){
       line(mouseX,mouseY,x,y); 
        x = mouseX;
        y = mouseY;
    }
    
    
    

    code

    tweaks (0)

    about this sketch

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

    license

    advertisement

    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

    kirk "kirkjerk" israel

    candycanepaint (javadvent day 4)

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

    from my Java Advent Calendar - http://kirkjerk.com/java/advent2009/
    "just paint with the mouse (space clears)"

    You need to login/register to comment.