Hello Processors, thank you for your time. I made an object using another object called Movie, so that two videos appear floating upwards and stay in the top. The code runs but only the white background appears.
import processing.video.*;
Movie myMovie;
Video v1;
Video v2;
void setup() {
size(640, 360);
myMovie = new Movie(this, "fogata.mp4");
myMovie.loop();
v1 = new Video(74);
v2 = new Video(26);// this is calling the constructor
}
void draw() {
background(255);
v1.display();
v1.ascend();
v1.top();
v2.display();
v2.ascend();
v2.top();
}
class Video {
//data
float x;
float y;
float size;
Video(float tempD) {//here is where initialization starts
x = width/2;
y = height;
size = tempD;
}
void ascend() {
y--;
x = x + random(-1, 1);
}
void top() {
if (y < size/2) {
y = size/2;
}
}
//functuality: function definitions
void display() {
image(myMovie, x, y, size, size);
}
}