Code sketch #7
This code sketch is inspired by a Pen by Gerard Ferrandez. I wanted to have squares that kept splitting in to smaller squares when clicked.
At first I tried pulling the square that is clicked out of the squares
array, but that was causing dramas (as the p5.js draw()
function was constantly looping through the array). So instead I just set a hide
property on the clicked square to true and stopped drawing the squares with hide = true
.
See the Pen 6.1 by Rachel Smith (@rachsmith) on CodePen.
I added a purples and pinks colour palette. I wanted to make it so the squares tweened in to their positions (from the larger square) but I ran out of time for that today. So I may update this one again in the future.
See the Pen code sketch #7 p5.js by Rachel Smith (@rachsmith) on CodePen.
This has been post no. 26 for #WeblogPoMo2024 and it is what I was interested in today.
Comments
Leave a Comment
💯 Thanks for submitting your comment! It will appear here after it has been approved.