After the last lesson I still didn't quite understand the true and false problem very well. So I wrote the logic of the toggling light switch problem, finally feeling clearer, and re-wrote the code myself.
https://editor.p5js.org/ElodieLiu/sketches/GQHI1Pz5R
https://editor.p5js.org/ElodieLiu/sketches/ttGRjYISc
light a star
https://editor.p5js.org/ElodieLiu/sketches/nKl67Rtbr
starsagain
https://editor.p5js.org/ElodieLiu/sketches/FEpDA1yqn
I wanted to make stars through the gap between the circles, so a drew a sketch first to see the relationship between the circles and “stars”.
Then I added some interactions and variation. By way of this process, I tried different codes, and for most of the time, it didn’t come out as I thought and I can’t even figure out how it turned out like this. This process really drove me crazy. Some effects look really simple but I just can’t realize them. It sure takes a lot of time and practice to master it(I mean coding) a little.