Untitled

 avatar
unknown
plain_text
2 years ago
2.5 kB
4
Indexable
import processing.sound.*;
SoundFile death;
SoundFile UGLY;

PImage doorOne;
PImage doorTwo;
PImage doorThree;

PImage eHead;
PImage eRightLeg;
PImage eLeftLeg;
PImage eRightArm;
PImage eLeftArm;
PImage spell;

PImage mainBackground;
PImage youDied;

float xDoor1, yDoor1, xDoor2, yDoor2, xDoor3, yDoor3;

//change this to -100 and make y 0 upon clicking the first door

float CPX1, CPX2, CPX3, CPX4, CPX5, CPY1, CPY2, CPY3, CPY4, CPY5;
float cardDiam;

boolean onDefaultScreen = true;
boolean onDeathScreen = false;

void setup(){
  //fullScreen();
  size (1600, 1700);
  
  death = new SoundFile(this, "youDiedSFX.mp3");
  UGLY = new SoundFile(this, "you'reUgly.mp3");
  
  doorOne = loadImage("doorOne.png");
  doorTwo = loadImage("doorTwo.png");
  doorThree = loadImage("doorThree.png");
  eHead = loadImage("exodiaOne.png");
  eRightLeg = loadImage("exodiaTwo.png");
  eLeftLeg = loadImage("exodiaThree.png");
  eRightArm = loadImage("exodiaFour.png");
  eLeftArm = loadImage("exodiaFive.png");
  spell = loadImage("spellbind.png");
  
  mainBackground = loadImage("mainBackground.png");
  youDied = loadImage("youDied.png");
  
  xDoor1 = 220;
  yDoor1 = 450;
  xDoor2 = 650;
  yDoor2 = 475;
  xDoor3 = 1000;
  yDoor3 = 250;
  CPX1 = 100;
  CPX2 = 100;
  CPX3 = 100;
  CPX4 = 100; 
  CPX5 = 100; 
  CPY1 = 200; 
  CPY2 = 300;
  CPY3 = 400; 
  CPY4 = 500; 
  CPY5 = 600;
  
if (onDefaultScreen == true){
 onDeathScreen = false;
image(mainBackground,0,0);
image(doorOne, xDoor1, yDoor1);
image(doorTwo, xDoor2, yDoor2);
image(doorThree,xDoor3,yDoor3);
}

}


 void mouseClicked(){
  if(onDefaultScreen == true){
    if(mouseX>xDoor1 && mouseX <xDoor1+230 && mouseY>yDoor1 && mouseY <yDoor1+400 ){
     image(youDied, -130,0);
     death.play();
     onDeathScreen = true;
     onDefaultScreen = false;
  }
    if(mouseX>xDoor3+100 && mouseX <xDoor3+500 && mouseY>yDoor3+100  && mouseY <yDoor3+600 ){
  UGLY.play();  
 }
   if(mouseX>xDoor2+50 && mouseX <xDoor2+250 && mouseY>yDoor2+50  && mouseY <yDoor2+400 ){
    onDefaultScreen = false;

   image(spell, -130,0);
      imageMode(CENTER);
   image(eHead,CPX1,CPY1,cardDiam,cardDiam);
   image(eRightLeg,CPX2,CPY2,cardDiam,cardDiam);
   image(eRightArm,CPX3,CPY3,cardDiam,cardDiam);
   image(eLeftLeg,CPX4,CPY4,cardDiam,cardDiam);
   image(eLeftArm,CPX5,CPY5,cardDiam,cardDiam);
     }
   }
 }
 
 
void draw(){
}
Editor is loading...