title: Processing mousePressed()
body: <p>I'm new to coding and currently I'm in a class that has us use Processing 3 with java. I'm working on a project trying to set up a mousePressed() action, so that 3 static images appear but it's not showing up. (sorry if this is a stupid question).</p>
  <p>Here's the code</p>
  <pre><code>PImage [] pics = new PImage [11];
  
  int base=0;
  int top=10;
  int dollar=9;
  
  boolean notPressed = true;
  
  void setup() {
    size(1200, 750);
    background(255);
    imageMode(CENTER);
  
    for (int i=0; i&lt;11; i++) {
      pics[i] = loadImage(&quot;pic&quot;+i+&quot;.png&quot;);
    }
  }
  
  void draw() {
  
    translate(500, 275);
    if (notPressed) {
      image(pics[int(random(1, 8))], 100, 100);
    } else {
      image(pics[base], 100, 100);
    }
    image(pics[top], 100, 100);
    image(pics[dollar], 100, mouseY);
  }
  
  pushMatrix();
  translate(500, 275);
  image(pics[int(random(pics.length))], 100, 100);
  popMatrix();
  
  pushMatrix(); //moves dollar up and down 
  translate(500, 275);
  image(pics[0], 100, 100);//base
  image(pics[9], 100, mouseY);//dollar
  popMatrix();
  }
  
  void mousePressed() {  
    notPressed=false;
  }
  
  void keyPressed() {
  }
  </code></pre>