Recitation 11: Media Manipulation (Justin Wu)

Reflection:

In this week’s recitation, I decided to join Leon’s group that focused on Media Manipulation through images and videos. As I intend to build a game for my final project, I wanted to figure out how I can manipulate images, videos that I can incorporate into my game.

Leon demonstrated how to apply filters, pixels to different images, videos and I decided to get a headstart on my final project.  Using what Leon demonstrated in class, I wanted to start creating my starting screen and a countdown video for my game.  As my game heavily revolves around music and rhythm, it is important to give users a countdown before immediately throwing them into the game. First, I began by searching for a suitable starting screen. I found a simple starting screen to begin with and included a mousePressed function after it. I intended to create a three step process 1) Starting Screen 2) Countdown 3) Game

After finding a starting screen and writing the mousePressed function, I found a popular countdown gif with the help of Professor Rudy.  By using a gif and not a video, it helped made my coding process easier. Processing identifies a gif as an image so I could continue using my original code from before.  As of right now, the gif will end after the countdown and bring you to a white screen. We intend for our game to replace the white screen and will replace it after we finish coding our music rhythm game.

Video:

Code:

import processing.video.*;
Movie myMovie;
void setup() {
size(720, 480);
photo = loadImage(“StartScreen.jpg”);
myMovie = new Movie(this, “giphy.mp4”);
//myMovie.play();
}
void draw() {
image(photo, 0, 0,width,height);
if (myMovie.available()) {
myMovie.read();
}
image(myMovie, 0, 0,width,height);
// Draws a line on the screen
// when the movie half-finished
float md = myMovie.duration();
float mt = myMovie.time();
if (mt >= md) {

background(255);

}
}

void mousePressed(){myMovie.play();}

Leave a Reply