• fullscreen
  • eyeballs_colorchange.pde
  • //Lauren Barnett
    //Eyeballs_Part_Two
    //Feb_9
    
    int x;
    int y;
    int value=#9EF02E; //movecolor;
    
    
    void setup() {
      size (500, 500);
      smooth();
      background(0);
    }
    
    void draw() {
      fill(255);
      for (int x=10; x<500; x=x+20) {
        for (int y=10; y<500; y=y+20) {
          ellipse (x, y, 20, 20);//whites of their eyes
        }
      }
    
      fill(#2EEBF0);
      for (int x=10; x<500; x=x+20) {
        for (int y=10; y<500; y=y+20) {
          ellipse (x, y, 10, 10);//color of their eyes
        }
      }
    
    
      fill(#000000);
      for (int x=10; x<500; x=x+20) {
        for (int y=10; y<500; y=y+20) {
          ellipse (x, y, 5, 5);//non-dialated pupil
        }
      }
    
        if (mouseX>=1 && mouseX<=500) {
          for (int x=10; x<500; x=x+20) {
            for (int y=10; y<500; y=y+20) {
              fill(#9EF02E);
              ellipse (x, y, 10, 10);//color of their eyes
            }}
             fill(#000000);
      for (int x=10; x<500; x=x+20) {
        for (int y=10; y<500; y=y+20) {
          ellipse (x, y, 5, 5);//non-dialated pupil
        }}
        
        //if(mouseX>400){
          //mouseX=600;
        //}
    println("X=" + mouseX); //so you know where you are
            }
          }
    
    
    
    
    
    

    code

    tweaks (0)

    about this sketch

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

    license

    advertisement

    Lauren Barnett plus+

    eyeballs_color_change

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

    Lauren:

    Great. Don't hesitate to clue us in with greater detail, though, in lines like this one:

    if (mouseX&gt;=1 && mouseX&lt;=500) {

    What is this line doing, and why? etc.

    Also: Consider removing the println statements from your final products -- they tend to be used for debugging, and may just confuse your average user.
    You need to login/register to comment.