9.25.2018

Coding is Better with Friends



It's dark and rainy, but spirits are high!  After a weekend spent with an infected piercing drooling out puss and my newly renovated closet that looks like a Muji ad I feel refreshed and renewed (minus Saturday morning where I thought my lip would fall off my face).

I hung out at the floor Monday afternoon after work and decided to wait until my partner arrived to work on ICM.  I watched a little of the movie "Black Panther" while picking at a microwaved bento box.

When Mary Ann arrived, she articulated how she was a little behind and how we shouldn't bother on her code.  I was like, nonsense, that's more code than I have.  Let's work on that!  Her goal was to get the background to shift from these different sea greens and have seaweed wave in the foreground.  I found it relaxing and we dove into figuring out how to make the color shift.

Using the knowledge we learned from IF statements I thought we could make a set to cover the color changing background:



We started to make variables for each background, and found that it might have been too much information for the variable, or we just using it the wrong way.

So back to her basic background colors, she wanted to cycle through 3 colors, so we backtracked just trying to make each background appear once.

Once we figured out the backgrounds, now was the IF statement.  What could we use as IF? That was the mind numbing question.  We dug through the internet and asked a few peers but none of the answers seemed to ingest.

I thought about the draw function, and how that is a loop.  So if we can have something to count each time it loops, we will have something to use for our IF statement.  I decided to use the good old X++ variable type.  Each time draw was utilized, X would increase by one.  And depending on the frame rate, we could control how often X increases by 1.  I was reluctant to use something based on frame rate because that might hinder the code if it gets more vast.  But then I was like I'm overthinking this, I'm not writing code for an OS.

So we adjusted the frame rate and wrote IF and Else statements.  If x was between these values then it the background color is this, so on.  Until we get to the end of the IF statement, we reset X back to the 1 so it starts the whole IF statement over again.  SO WE GOT A LOOP.




The excitement was real when I threw my hands up after 2 hours of looking at complex functions and code to do what seemed a simple task.

The next step is how do we shift the colors subtly like a gradient.  This seemed easier as we just had to give the background some variables that shift every time the Draw loop is initiated.

Once Mary Ann left for work, I found myself lost in a hole trying to get a very simplified goldfish to turn around once it reaches the edge of the frame.

I got it to turn around in many ways, all were quite entertaining but not my image of turn this 2d object around slowly along it's Y axis so it looks 3D.

After becoming brain dead from this 2D ellipse I decided to time the gradient changes to some nice deep breathes.  If all else fails this will be a nice meditative color-shift with, perhaps, a sporadic fish of sorts.

 
Just kidding, I added more and I kept crashing my computer with my sound loop.

No comments: