PImage a;          //person image
PImage a_1;        //flip person image
PImage c;          //wave image
PImage d;          //evil cup image
PImage e;          //big evil cup image
int m=millis();  
float i=300;       //for drip funtion
int numFrames=13;
int frame=0;
PImage[] images=new PImage[numFrames];
boolean cupIsPressed=false;
int cupX=300;
int cupY=150;
int cupW=51;
int cupH=41;

void setup()
{
  size(600, 300);
  background(255);
  framerate(9);

  c=loadImage("wave.gif");
  a=loadImage("person.gif");
  a_1=loadImage("personflip.gif");
  e=loadImage("bigevilcup.gif");
  d=loadImage("evilcup.gif");
    
  images[0]  = loadImage("cup1.gif"); 
  images[1]  = loadImage("cup2.gif"); 
  images[2]  = loadImage("cup3.gif"); 
  images[3]  = loadImage("cup4.gif"); 
  images[4]  = loadImage("cup5.gif"); 
  images[5]  = loadImage("cup6.gif"); 
  images[6]  = loadImage("cup7.gif"); 
  images[7]  = loadImage("cup8.gif"); 
  images[8]  = loadImage("cup9.gif"); 
  images[9]  = loadImage("cup10.gif"); 
  images[10] = loadImage("cup11.gif"); 
  images[11] = loadImage("cup12.gif"); 
  images[12] = loadImage("cup13.gif");
}

void draw()
{
  float m=millis();
  person();
  if(mousePressed==true)
  {  
    drip();
  }
  if(m>8000 && m<=13000)
  {
    background(255);
    person();
    i-=7;
    image(c, 0, i);
  }
  if(m>13000 && m<=16000)
  { 
    image(c, 0, -20);
  }
  if(m>16000 && m<=18000)
  {
    push();
    background(255);
    i+=20;
    image(c, 0, i);
    pop();
  }
  if(m>18000)
  {
    background(255);
    evilcup();
  }
}

void person()
{
  if (mouseX<200)
  {
    background(255);
    image(a, mouseX, 0);
  }
  else
  {
    background(255);
    image(a_1, mouseX, 0);
  }
}
void drip()
{
  frame = (frame+1)%numFrames;
  image(images[frame], width/2, 5);
}
void mousePressed()
{
  if(mouseIsOverCup())
  {
    cupIsPressed=true;
  }
}
void mouseReleased()
{
  cupIsPressed=false;
}
void evilcup()
{
  if(cupIsPressed)
  {
    image(e, 300, 150);
  }
  else
  {
    imageMode(CENTER);
    image(d, cupX, cupY, cupW, cupH);
  }
}
boolean mouseIsOverCup()
{
  if(mouseX>=cupX-cupW/2 && mouseX<=cupX+cupW/2 && mouseY>=cupY-cupH/2 && mouseY<=cupY+cupH/2)
  {
    return true;
  }
  else
  {
    return false;
  }
}
Project 2: Soft Comics
Using McCloud's graphic essay as a foundation for understanding comics, imagine how graphic storytelling can be extended in software. Create a responsive visual environment as a test of your ideas.