ICM Week 5
This week, I worked on creating a sketch using object oriented code. Since we also learned about arrays, I also wanted to work with that too. My inspiration started when I saw the SNL Papyrus Skit, which reminded me of every time I've cringed seen Curlz MT used in earnest and also this gem.
As a result, I created functions turn a .txt file of Waves into various arrays of letters or words, and then a couple functions to play with how they are drawn in p5.js. I wanted to add more ways to alter & move the text, but I didn't really have time. Here it is below and the full code is available here.
My process mostly consisted of me creating code from one item I wanted in my sketch, and then reworking it into a function that I would then put into a class. For instance, when creating the object for my functions that would turn the incoming .txt file into the arrays I wanted, I started with this.
And then I would add a lot of "this." and rename variables to make the code work. There was a lot of trial and error, which I am anticipating will take me less time in the future. Following this, I ended up with the following class/object for making my arrays.
From there I was able to play with how I would display the words. I tried a couple of different loop to see how the arrays would print out.
Soon, I wanted to make the text more dynamic by adding functions to animate it. I soon got into this whole mess with dealing with arrays inside arrays and how to manipulate those. I made another class/object to do this. I once again started with something coded for an individual item, like my tilting text.
And then turned it into a function which is in my class/object.
I was having trouble with somehow ending up with this mess of arrays inside arrays. Or how to call use a function on an object that is already having something done to it. My terminology is not correct, but for instance if I have this in my draw function: stuff.doSomething(arg1, arg2);
But I wanted to do another thing to it using a function in the same class. Would it look like this: stuff.doAnotherThing(stuff.doSomething(arg1, arg2));
I'll need to ask about this in class/office hours.