import krister.Ess.*; PFont title, label; int timer; int rightSide = 450; float r = 10.0001; int rInt = 0; int soundsC = 0; int soundsT = 0; int soundsR = 0; int activeSounds = 0; float starGrow=0; int illegalGrow=0; AudioChannel thrillerIntro; AudioChannel thrillerMiddle; AudioChannel thrillerEnd; AudioChannel cowbellBeat; AudioChannel boratBeat; AudioChannel rattleBeat; AudioChannel suchAGoodVibration; AudioChannel paradiseCity; AudioChannel drPepper; AudioChannel atari; AudioChannel juicyFruit; AudioChannel thatsHot; color soundClick1on = color(255,255,0); color soundClick1off = color(90); boolean cowbellBeatBoolean = false; boolean boratBeatBoolean = false; boolean rattleBeatBoolean = false; boolean suchAGoodVibrationBoolean = false; boolean paradiseCityBoolean = false; boolean drPepperBoolean = false; boolean atariBoolean = false; boolean juicyFruitBoolean = false; boolean thatsHotBoolean = false; boolean mouseReset=false; int numFrames = 2566; // The number of frames in the animation int numAddImages = 21; int numStartAlpha = 16; int frame = 0; int i = 0; int screenSizeX = 800; int screenSizeY = 600; int movieX = 140; int movieY = 116; int mX = 0; int mY = 0; int cUpX = 542; int cUpY = 64; int tUpX = 612; int tUpY = 64; int rUpX = 687; int rUpY = 64; int cDownX = cUpX+26; int cDownY = cUpY+436; int tDownX = tUpX+26; int tDownY = tUpY+436; int rDownX = rUpX+26; int rDownY = rUpY+436; int cVal = 3; int tVal = 16; int rVal = 16; int imagesIn = 0; boolean legal = false; boolean illegal = false; String zeros = "000"; String imageName; PImage[] images = new PImage[numFrames]; PImage[] addImages = new PImage[numAddImages]; PImage[] addImagesAlpha = new PImage[numAddImages]; PImage star; PImage starA; int[] imagesInList = new int[numAddImages]; int cIn = 0; int tIn = 0; int rIn = 0; //PImage[] addImagesNoAlpha = new PImage[numaddImagesNoAlpha-29]; int[] danceX = new int[numFrames]; int[] danceY = new int[numFrames]; boolean[] activeImages = new boolean[numAddImages]; boolean[] activeImagesSwitch = new boolean[numAddImages]; boolean[] activeImagesWasIn = new boolean[numAddImages]; String[] moveX = new String[numFrames]; String[] moveY = new String[numFrames]; //String importMoveX[] = loadStrings("moveX.txt"); //String importMoveY[] = loadStrings("moveY.txt"); PImage singleImage; PImage cop; PImage copA; int copX = screenSizeX; int copY = 20; int copD = 0; int[] addImagesX = new int[numAddImages]; int[] addImagesY = new int[numAddImages]; int[] addImagesXplus = new int[numAddImages]; int[] addImagesYplus = new int[numAddImages]; int addI=0; boolean[] addImagesBoolean = new boolean[numAddImages]; boolean grab=false; boolean roundOnce = false; void setup() { title = loadFont("Avenir-Book-26.vlw"); label = loadFont("Avenir-Heavy-18.vlw"); Ess.start(this); thrillerIntro=new AudioChannel("thrillerIntro.wav"); thrillerMiddle=new AudioChannel("thrillerMiddle.wav"); thrillerEnd=new AudioChannel("thrillerEnd.wav"); cowbellBeat=new AudioChannel("cowbellBeat.wav"); boratBeat=new AudioChannel("boratBeat.wav"); rattleBeat=new AudioChannel("rattleBeat.wav"); suchAGoodVibration=new AudioChannel("suchAGoodVibration.wav"); paradiseCity=new AudioChannel("paradiseCity.wav"); drPepper=new AudioChannel("drPepper.wav"); atari=new AudioChannel("atari.wav"); juicyFruit=new AudioChannel("juicyFruit.wav"); thatsHot=new AudioChannel("thatsHot.wav"); cop = loadImage("cop.jpg"); copA = loadImage("copA.jpg"); cop.mask(copA); starA = loadImage("starA.jpg"); star = loadImage("star.jpg"); star.mask(starA); size(screenSizeX, screenSizeY); framerate(24); for (int iY = 385; iY < 580 && addI < numAddImages; iY=iY+60){ for (int iX = 20; iX < 400 && addI < numAddImages; iX=iX+60){ addImagesX[addI]=iX; addImagesY[addI]=iY; addI++; } } for (int i = 0;i15 && mouseY>170 && mouseX<105 && mouseY<190){ if (boratBeatBoolean==true){ boratBeatBoolean=false; } else{ boratBeatBoolean=true; } } if (mouseX>15 && mouseY>190 && mouseX<105 && mouseY<210){ if (cowbellBeatBoolean==true){ cowbellBeatBoolean=false; } else{ cowbellBeatBoolean=true; } } if (mouseX>15 && mouseY>210 && mouseX<105 && mouseY<230){ if (rattleBeatBoolean==true){ rattleBeatBoolean=false; } else{ rattleBeatBoolean=true; } } if (mouseX>15 && mouseY>230 && mouseX<105 && mouseY<250){ if (suchAGoodVibrationBoolean==true){ suchAGoodVibrationBoolean=false; } else{ suchAGoodVibrationBoolean=true; } } if (mouseX>15 && mouseY>250 && mouseX<105 && mouseY<270){ if (paradiseCityBoolean==true){ paradiseCityBoolean=false; } else{ paradiseCityBoolean=true; } } if (mouseX>15 && mouseY>270 && mouseX<105 && mouseY<290){ if (drPepperBoolean==true){ drPepperBoolean=false; } else{ drPepperBoolean=true; } } if (mouseX>15 && mouseY>290 && mouseX<105 && mouseY<310){ if (atariBoolean==true){ atariBoolean=false; } else{ atariBoolean=true; } } if (mouseX>15 && mouseY>310 && mouseX<105 && mouseY<330){ if (juicyFruitBoolean==true){ juicyFruitBoolean=false; } else{ juicyFruitBoolean=true; } } if (mouseX>15 && mouseY>330 && mouseX<105 && mouseY<350){ if (thatsHotBoolean==true){ thatsHotBoolean=false; } else{ thatsHotBoolean=true; } } mouseReset=false; } } if (!mousePressed){ mouseReset=true; } //println(soundClick1Boolean); textFont(label,16); if (cowbellBeatBoolean==true){ fill(soundClick1on); } else{ fill(soundClick1off); } text("cowbell beat", 15, 210); if (boratBeatBoolean==true){ fill(soundClick1on); } else{ fill(soundClick1off); } text("Borat's beat", 15, 190); if (rattleBeatBoolean==true){ fill(soundClick1on); } else{ fill(soundClick1off); } text("rattle beat", 15, 230); if (suchAGoodVibrationBoolean==true){ fill(soundClick1on); } else{ fill(soundClick1off); } text("good vibration", 15, 250); if (paradiseCityBoolean==true){ fill(soundClick1on); } else{ fill(soundClick1off); } text("Paradise City", 15, 270); if (drPepperBoolean==true){ fill(soundClick1on); } else{ fill(soundClick1off); } text("Dr. Pepper", 15, 290); if (atariBoolean==true){ fill(soundClick1on); } else{ fill(soundClick1off); } text("Atari", 15, 310); if (juicyFruitBoolean==true){ fill(soundClick1on); } else{ fill(soundClick1off); } text("Juicy Fruit", 15, 330); if (thatsHotBoolean==true){ fill(soundClick1on); } else{ fill(soundClick1off); } text("That's hot", 15, 350); textFont(label,14); fill(165); text("(drag images over video)", movieX-1, 365); //text("drum beat 2", 15, 210); fill (255,225,225,200+timer%355); textFont(title, 24); //text("Intellectual Property", 140, 50); //text("Theft Simulator", 140, 80); text("Intellectual Property Theft Simulator", 30, 44); textFont(title,16); text("The more you mix, the more legal it gets.", 72, 70); //textFont(title,12); //text("Sort of.", 367, 70); textFont(label); pushMatrix(); translate(15,0); fill (0,0,13+(timer%400)/100); rect(430,0,400,600); fill (255,225,225,200+timer%355); text("ILLEGAL", 440, 75); fill(105); rect(515,68,230,4); rect(520,174,210,2); rect(510,281,230,4); rect(520,386,210,2); rect(510,492,230,4); fill(25); rect(525,122,205,2); rect(525,226,205,2); rect(525,334,205,2); rect(525,438,205,2); fill (255,0,0,200); textFont(title, 18); pushMatrix(); translate(475,560); rotate(radians(-25)); text("copyright", 0, 0); popMatrix(); pushMatrix(); translate(557,563); rotate(radians(-25)); fill (0,255,0,200); text("trademark", 0, 0); popMatrix(); pushMatrix(); translate(607,584); rotate(radians(-25)); fill (0,0,255,200); text("right of publicity", 0, 0); popMatrix(); fill (255,0,0,200); rect(540,62,30,440); fill (0,255,0,200); rect(610,62,30,440); fill (0,0,255,200); rect(685,62,30,440); fill(0); rect(542,64,26,436); rect(612,64,26,436); rect(687,64,26,436); rectMode(CORNERS); fill (255,0,0,200); //if (imagesIn>3){ cIn=3-cIn; tIn=16-tIn; rIn=14-rIn; cVal=cIn; tVal=tIn; rVal=rIn; //} if (cVal<0){ cVal=0; } if (cVal>16){ cVal=16; } if (tVal<0){ tVal=0; } if (tVal>16){ tVal=16; } if (rVal<0){ rVal=0; } if (rVal>16){ rVal=16; } if(imagesIn<4 && activeSounds<4){ cUpY=cVal*27; tUpY=tVal*27; rUpY=rVal*27; } if(imagesIn>=4 || activeSounds>=4){ if(imagesIn<9 && activeSounds<6){ cUpY=(cVal+imagesIn+activeSounds)*27; tUpY=(tVal+imagesIn+activeSounds)*27; rUpY=(rVal+imagesIn+activeSounds)*27; } } if(imagesIn>=9 || activeSounds>=6){ cUpY=(cVal+imagesIn+activeSounds*2)*27; tUpY=(tVal+imagesIn+activeSounds*2)*27; rUpY=(rVal+imagesIn+activeSounds*2)*27; } if(cUpY>cDownY-66){ cUpY=cDownY-66; } if(tUpY>tDownY-66){ tUpY=tDownY-66; } if(rUpY>rDownY-66){ rUpY=rDownY-66; } if (tVal==15 && imagesIn<4 && activeSounds<4){ tUpY=240; } if (rVal==13 && imagesIn<4 && activeSounds<4){ rUpY=240; } if (tVal==14 && imagesIn<5 && activeSounds<4){ tUpY=140; } if (rVal==12 && imagesIn<5 && activeSounds<4){ rUpY=140; } println(cUpY); println(tUpY); println(rUpY); if (cUpY>430 && tUpY>430 && rUpY>430){ legal=true; } else{ starGrow=0; legal=false; } rect(cUpX,66+cUpY+random(-2,2),cDownX,cDownY+1); fill (0,255,0,200); rect(tUpX,66+tUpY+random(-2,2),tDownX,tDownY+1); fill (0,0,255,200); rect(rUpX,66+rUpY+random(-2,2),rDownX,rDownY+1); rectMode(CORNER); popMatrix(); if (i==1){ if (thrillerEnd.state==Ess.PLAYING) { thrillerEnd.stop(); } thrillerIntro.play(1); } if (i<1858 && i>132){ if (thrillerIntro.state==Ess.PLAYING) { thrillerIntro.stop(); } thrillerMiddle.play(5); } if (i==1858){ thrillerEnd.play(5); if (thrillerMiddle.state==Ess.PLAYING) { thrillerMiddle.stop(); } } i=i+1; if (i>numFrames){ //output.flush(); // Writes the remaining data to the file //output.close(); // Finishes the file //exit(); // Stops the program roundOnce=true; i = 0; /*if (myChannel.state==Ess.STOPPED) { myChannel.play(); }*/ } if (i>=1000){ zeros=""; } if (i<1000){ zeros="0"; } if (i<100){ zeros="00"; } if (i<10){ zeros="000"; } imageName = "thriller" + zeros + i + ".jpg"; singleImage = loadImage(imageName); image(singleImage, movieX, movieY); if (mousePressed){ for(int i = 0; i=addImagesX[i]+addImagesXplus[i] && mouseX<=(addImagesX[i]+addImages[i].width)+addImagesXplus[i] && mouseY>=addImagesY[i]+addImagesYplus[i] && mouseY<=(addImagesY[i]+addImages[i].height)+addImagesYplus[i] && grab==false){ addImagesBoolean[i]=true; } if(addImagesBoolean[i]==true){ addImagesX[i]=(mouseX-addImages[i].width/2); addImagesY[i]=(mouseY-addImages[i].height/2); } } } else{ for(int i=0; i=hamsterX+hamsterXplus && mouseX<=(hamsterX+hamsterI.width)+hamsterXplus && mouseY>=hamsterY+hamsterYplus && mouseY<=(hamsterY+hamsterI.height)+hamsterYplus && grab==false){ hamster=true; } if(hamster==true){ hamsterX=(mouseX-hamsterI.width/2); hamsterY=(mouseY-hamsterI.height/2); } if (mouseX>=firefoxX+firefoxXplus && mouseX<=(firefoxX+firefoxI.width)+firefoxXplus && mouseY>=firefoxY+firefoxYplus && mouseY<=(firefoxY+firefoxI.height)+firefoxYplus && grab==false){ firefox=true; } if(firefox==true){ firefoxX=(mouseX-firefoxI.width/2); firefoxY=(mouseY-firefoxI.height/2); } } else{ hamster=false; firefox=false; } if (hamster==true || firefox==true){ grab=true; }else{ grab=false; } if (hamsterX>=105-hamsterI.width/2 && hamsterX <= 385-hamsterI.width/2 && hamsterY>=136-hamsterI.height/2 && hamsterY <= 346-hamsterI.height/2){ println("goooooooooooooo!"); hamsterXplus = danceX[i]; hamsterYplus = danceY[i]; } else{ hamsterXplus=0; hamsterYplus=0; } if (firefoxX>=105-firefoxI.width/2 && firefoxX <= 385-firefoxI.width/2 && firefoxY>=136-firefoxI.height/2 && firefoxY <= 346-firefoxI.height/2){ println("goooooooooooooo!"); firefoxXplus = danceX[i]; firefoxYplus = danceY[i]; } else{ firefoxXplus=0; firefoxYplus=0; } */ imagesIn=0; for(int j=0;j=movieX-addImages[j].width/2 && addImagesX[j] <= (movieX+280)-addImages[j].width/2 && addImagesY[j]>=movieY-addImages[j].height/2 && addImagesY[j] <= (movieY+210)-addImages[j].height/2){ addImagesXplus[j] = danceX[i]; addImagesYplus[j] = danceY[i]; rInt = round(random(-1.7,1.7)); addImagesXplus[j] = addImagesXplus[j]+rInt; rInt = round(random(-1.7,1.7)); addImagesYplus[j] = addImagesYplus[j]+rInt; activeImages[j] = true; activeImagesWasIn[j]=true; //activeImagesSwitch[j]==false imagesIn++; imagesInList[j] = 1; } else{ addImagesXplus[j]=0; addImagesYplus[j]=0; activeImages[j] = false; activeImagesSwitch[j] = false; imagesInList[j] = 0; } image (addImages[j],addImagesX[j]+addImagesXplus[j],addImagesY[j]+addImagesYplus[j]); } /* if(activeImages[0]==true && activeImagesSwitch[0]==false){ if (imagesIn<3){ tVal--; cVal--; }else{ tVal++; cVal++; } activeImagesSwitch[0]=true; } if(activeImagesWasIn[0]==true && activeImages[0]==false){ if (imagesIn<3){ tVal++; cVal++; }else{ tVal--; cVal--; } activeImagesWasIn[0]=false; } if(activeImages[1]==true && activeImagesSwitch[1]==false){ if (imagesIn<3){ cVal--; }else{ cVal++; } activeImagesSwitch[1]=true; } if(activeImagesWasIn[1]==true && activeImages[1]==false){ if (imagesIn<3){ cVal++; }else{ cVal--; } activeImagesWasIn[1]=false; } if(activeImages[2]==true && activeImagesSwitch[2]==false){ if (imagesIn<3){ cVal--; }else{ cVal++; } activeImagesSwitch[2]=true; } if(activeImagesWasIn[2]==true && activeImages[2]==false){ if (imagesIn<3){ cVal++; }else{ cVal--; } activeImagesWasIn[2]=false; } if(activeImages[3]==true && activeImagesSwitch[3]==false){ if (imagesIn<3){ cVal--; }else{ cVal++; } activeImagesSwitch[3]=true; } if(activeImagesWasIn[3]==true && activeImages[3]==false){ if (imagesIn<3){ cVal++; }else{ cVal--; } activeImagesWasIn[3]=false; } println(imagesIn); */ cIn=0; tIn=0; rIn=0; for(int j=0;j