import ddf.minim.*;

Minim minim;
AudioPlayer player;

int size = 1;

boolean button = false;

/* Try to get two buttons working simultaneously */

// Square //
/* int rectX = 25;
int rectY = 275;
int rectW = 200;
int rectH = 200; */

// Circle //
int circleX = 300;
int circleY = 300;
int circleW = 200;
int circleH = 100;

PImage bg;

void setup (){
size (600,600);

minim = new Minim(this);

player = minim.loadFile("crisis.mp3");

  
  
background(0);
bg = loadImage("magma.jpg");
}

void draw (){
  if (button) {
      tint(255,50);
      background (random(0,255),0,0);
      image(bg, 0, 0);
      noStroke();
      noTint();
      fill(random(25));
      /* I hope nobody has a seizure... */
      ellipse(random(600),random(600),50,50);
      fill(random(255),0,0,random(255));
      ellipse(random(600),random(600),10,10);
      ellipse(random(600),random(600),20,20);

      fill(random(25));
      
      player.play();
      
}
  else{ 
      stroke(215);
      background(255);
      fill(230);
      
      player.pause();


}

// Circle //

ellipse(circleX,circleY,circleW,circleH);


}

// Button //

void mousePressed() {
  if (mouseX > circleX && mouseX < circleX+circleW && mouseY > circleY && mouseY < circleY+circleH) {
    button = !button;
  }
}

