Anonymous Anonymous - 26 days ago
269 0

No description

Java

sadasd

PFont font;
PImage bg1;
PImage keelelogo;
PImage bg2;
PImage bg3;
PImage employment;
PImage percent;
PImage research;
PImage keelesu;
PImage keelewoodsblur;

 

int transparency1;
int transparency2;
int startTime;
int i;
int a;
int begin; 
int duration = 20;
int time = 20;
int N = 50;
int F = 4;
ParticleSystem[] pSys;

int[] angles = {15,345};
int[] angles2 = {13, 347};
int[] angles3 = {11, 351};



void setup () {
  size(1170,775);
  font = loadFont ("SegoeScript-48.vlw");
  textFont (font);
  bg1 = loadImage("keele-library.jpg");
  bg2 = loadImage("keelehall.jpg");
  bg3 = loadImage("keelehallblur.jpg");
  keelelogo = loadImage("keelelogo.png");
  percent = loadImage("top4%.png");
  research = loadImage("research.png");
  employment = loadImage("employment.png");
  keelesu = loadImage("keelesu.png");
  keelewoodsblur = loadImage("unidriveblur.png");
  transparency1 = 255;
  transparency2 = 255;
  frameRate(23);
  startTime = millis();
  noStroke();
  size(800, 600);
  noStroke();
  pSys = new ParticleSystem[F];
  for(int f = 0; f < F; f++){
    pSys[f] = new ParticleSystem();
  }
}




void draw () {
  image(bg1,0, 0);
  //textAlign(CENTER, TOP);
 
  fill(#FFFFFF);
  textSize(70);
  keelelogo.resize(595,308); //2:1
  image(keelelogo, 0, 0);
  text("Its time to choose Keele!",150,740);
  
  
   if(transparency1 > 0){
      transparency1 = transparency1 -2;
    }
   tint(255,255,255,255-transparency1);
  
  if (millis() - startTime > 1500){
      animation();
      } 
     
     
    
   
}
void animation(){
  
 image(bg3,0, 0);
  noTint();
  tint(255,255,255,a);
  image(bg2,0, 0);
  
  if(a<255)
    a = a + 5;
    pieChart(300, angles);
    pieChart2(300, angles2);
    pieChart3(300, angles3);
    
    image(percent,120 ,350);
    image(research,495,350);
    image(employment,880,350);
    fill(#FFFFFF);
    text("#KeeleBecause",295,720);
    
    if (millis() - startTime > 4500){
      animation2();
      } 
    
  
 //maybe add logo
 
 }

void animation2(){
  image(keelesu,0 ,0);
  
  
    
  if (time > 0){  
    time = duration - (millis() - begin)/1000;
    textSize(40);
    fill(#F50C62);
    text("Countdown to your time at keele!", 200,300);
    fill(#050505);
    textSize(70);
    text(time, 520, height/2);
    fill(#050505);
    
}
  if (time == 0) {
    fireworks();
  }
    

  
  
}



void fireworks() { 
for(int f = 0; f < F; f++){
    pSys[f].show();
    pSys[f].move();
    if (pSys[f].p[0].age > pSys[f].p[0].lifeTime && random(0, 1) > 0.95) {
      pSys[f].launch(new PVector(random(100, 700), random(50, 400)), 
        color(random(0, 255), random(0, 255), random(0, 255)));
    }
  }
  }
 


void pieChart(float diameter, int[] data) {
  float lastAngle = 0;
  for (int i = 0; i < data.length; i++) {
    
    if(i == 1){
      fill(#92c3fb);
    } else {
        fill(#e94d24);
      }
    arc(200, 170, diameter, diameter, lastAngle, lastAngle+radians(data[i]));
    lastAngle += radians(data[i]);
  }
  






}

  
  
  void pieChart2(float diameter, int[] data) {
  float lastAngle = 0;
  for (int i = 0; i < data.length; i++) {
    
    if(i == 1){
      fill(#92c3fb);
    } else {
        fill(#006c86);
      }
    arc(575, 170, diameter, diameter, lastAngle, lastAngle+radians(data[i]));
    lastAngle += radians(data[i]);
  }

}

  
  
  void pieChart3(float diameter, int[] data) {
  float lastAngle = 0;
  for (int i = 0; i < data.length; i++) {
    
    if(i == 1){
      fill(#92c3fb);
    } else {
        fill(#a52643);
      }
    arc(960, 170, diameter, diameter, lastAngle, lastAngle+radians(data[i]));
    lastAngle += radians(data[i]);
  }

  }