Week 4 – What is the meaning of life?

Inspiration

“What is the meaning of life?” I always wonder about the answer to this question, whenever I get a bad mark/eat sweets that ruin my face/pet cats that I am allergic to, and more. It’s a very difficult question, so why not generate text that will showcase the chaos of answers we might get, even with my limited abilities.

Understanding Arrays

So, the main thing that I got from the video was that the array was that of a list that starts from 0 and goes upwards. So, it can pull out any number from that list that would be identified with, in our case, a word, and thus, we can get that word out on the screen. Like, I tried to do that with keyPressed function, and there, each time that I pressed the “space”, words will change. Like, I had a question “what is the meaning of life” and another text with variants using the array (live, laugh, love). So, each time I pressed space the meaning of life would change! :D, how cool is that?

So, for the final product, I just repeated the scary thingy we did in class since it took a lot of time for me to understand how everything interacts together. Then, I added the twist with the live, laugh, and love. The meaning does indeed change very fast since life is fleeting with each second that you might be reading this is to capture this temporal event.

Project Version number 1

String [] meaningofLife = {"Live", "Love", "Laugh"} ;
String meaningHolder = ""; //store whatever name we randomly pull out of the array
String question = "What is the meaning of life?";
PFont myFont;
int xPos;


void setup() {
  size (2500, 1500);
  myFont = createFont("Courier New", 72);
  textFont(myFont);
  textAlign(CENTER);
  textSize(100);
  xPos = width;
  //println(meaningofLife.length); discover how many characters there are
  
}

void draw() {
  background (255);
  fill(0);
  textSize(90);
  //text (question, width/2, 300);
  xPos -=4;
  
  if  (xPos<= - textWidth(question)) {
   xPos = width; 
  }
 
  for (int i=0; i<question.length(); i++) {
   char c =  question.charAt(i);
   float x = width/4 + i*textWidth(c);
   float y = height/4 + random(-5, 5);
   text(c, x, y);
  }
}

void mouseMoved() {
  textSize(random(40, 72));
  meaningHolder = meaningofLife[int(random(meaningofLife.length))];
  text(meaningHolder, mouseX, mouseY);
}

However, after a meeting with the Professor, a question of the design was brought up, so I tried to make the design more intentional. Here, I added a more chaotic atmosphere, eased my job with for() function. I especially like how at some point the random function just goes out of hand and all meaning disappears leaving jiggling “what is the meaning of life?” text. As if showing the scariness of the question, feeling of being lost as to what is exactly the meaning of life.

String [] meaningofLife = {"Live", "Love", "Laugh", "Nothing", "Family", "Knowledge"} ;
String meaningHolder = ""; //store whatever name we randomly pull out of the array
String question = "What is the meaning of life?";
PFont myFont;
PFont myFont2;
int xPos;


void setup() {
  size (2500, 1500);
  myFont = createFont("Courier New Bold", 72);
  myFont2 = createFont("Courier New Italic", 72);
  textAlign(CENTER);
  textSize(100);

  //println(meaningofLife.length); discover how many characters there are
}

void draw() {
  textFont(myFont);
  background (50);
  fill(0);
  xPos -=4;

  if  (xPos<= - textWidth(question)) {
    xPos = width;
  }

  for (int i=0; i<question.length(); i++) {
    char c =  question.charAt(i);
    float x = width/4 + i*textWidth(c);
    float y = height/4 + random(-5, 5);
    text(c, x, y);
  }
}
void mouseMoved() {
   textFont(myFont2);
   fill(255);
  for (int i=0; i<5; i++) {
    textSize(random(66, 72));
    float w;
    float h;
    meaningHolder = meaningofLife[int(random(meaningofLife.length))];
    w = random(i*100, i*900);
    h = random (i, i*500);
    text(meaningHolder, w, h);
  }
}

 

Credit

This guy is awesome, love this guy for the way he explains stuff, and he shall be my savior for this assignment!

One thought on “Week 4 – What is the meaning of life?”

Leave a Reply