ASSIGNMENT #5 - OBJECTS & ARRAYS
I really struggled this week and need to go over the material again. My initial idea was to draw a calendar that every time the user clicked on a day, an image of a beer would appear. It would be called ‘Brett Kavanugh’s calendar’. This is as far as I got…..
I was trying to find a simpler way, using for loops, to draw the calendar grid without having to draw square by square but I struggled with the text and number assignments.
Then I couldn’t figure out how to load an image. Everyone said it was really easy, so for my intellect’s self esteem, I’m hoping I’m just missing something simple (I will spend more time on it).
After not being able to figure those out, I realized I also didn’t know how to incorporate the array which was the whole point of the exercise so I looked for a new idea (a little too late at this point) but I will figure this one out!
Inspired by The Game of Life example in the p5 library and using The Coding Train code for eliminating an object from an array, I drew my second sketch. What I wanted to do was sort of reverse The Game of Life’s interaction, where the user could click on parts of the grid and “eliminate” squares in order to draw whatever they want. I say “eliminate” because what I was trying to do was that every time the user clicked a black square would be drawn (instead of spliced) achieving the same effect.
I have not been able to get it to work yet so here is my failed attempt: https://editor.p5js.org/aileenstanziola/sketches/B1XPv6n57