Here is the link to my sketch:
https://editor.p5js.org/WentaoWang/sketches/3yXg7CxLO
In this project, when mouse is pressed on a certain location, it will change the color of that row and column the mouse is positioned. The color is determined by the location of the x and y coordinate of the mouse. When you press the mouse and move it around the canvas, you will see a beautiful change of color pattern. If you move the mouse in different direction, the picture shows different color pattern.
To be honest, this was not what I originally intended to make. I was trying to make a light-out puzzle like shown in this image at first. But I found it hard to change the color, preserving the state of the color, and change the state of a square. I was able to change the color of the four squares around the mouse location, so I decided to go down that road, and in the end, creating my project.
Hi Peter, this is a very satisfying interactive painting experience! There’s definitely benefit to experimenting with new design ideas as you are developing code. Next week, we’ll dive into objects, which you might consider a possible solution for preserving color states of the shapes in each grid cell. You’ve worked with those in your IMA classes, yes? I notice on your blog herer that you took Nature of Code, and I know classes and objects are used throughout that material. With you past experience, you are always welcome and encouraged to go beyond the concepts that are introduced in this class.