top of page

work 3_interactive video

04   /   04   /   2018

WORK 3

​

Why did i choose this scene because i love the song, Marry Your Daughter by Brian McKnight. I always listen to this song, and i remember about this scene from A Walk To Remember movie, so I get inspired of this assignment.

​

We can use 'a' to play the song, and click mouse to show the confetti.

​

https://drive.google.com/open?id=1X2D25CmyszYRFyI0ivANPSeWhiTP9B7e

CODE

 

 

PImage img;
PImage outdoor1;
PImage Bride_1;
PImage birds;
import processing.sound.*;
SoundFile file;
Drops d[];
int stage;
boolean drop =false;


void setup() {
   stage = 1;
   size(1000, 800);
   outdoor1 = loadImage("outdoor1.png");
   Bride_1 = loadImage("Bride_1.png");
   file = new SoundFile(this, "Marry Your Daughter.mp3");
   d = new Drops[500];
   for(int i=0;i<500;i++){
     d[i] = new Drops();
   }

}

void draw() {
     
   if (stage == 1){
      img = outdoor1;
      image(outdoor1,500,400);
    }
    
    imageMode(CENTER);
    image(Bride_1, 500, 600);
    
    if (mousePressed && (mouseButton == LEFT)) {
    drop = true;
    d = new Drops[500];
   for(int i=0;i<500;i++){
     d[i] = new Drops();
   }
  }
  if (drop){
    for(int i=0;i<500;i++){
     d[i].display();
   }
  }
    

   
}

   void keyPressed() {
   if (key == 'a')  {
     file.play();
   }
  }
  
  
  
class Drops{
  
  float x,y,speed;
  color c;
  Drops() {
    x = random(width);
    y = random(-300,0);
    speed = random(5, 10);
    c = color(random(255), random(255), random(255));
  }
  
  void update() {
    y+=speed;
  }
  void display() {
    fill(c);
    noStroke();
    rect(x, y, 2, 15);
    update();
  }
}

​

THANK YOU.

bottom of page