I’ve just started learning P5 and have just made an simplistic randomized program.
I’m looking to make it a touch more complex but the 3 things I want to do, I don’t even have the coding vocabulary/thought process to know where to even begin looking on the reference page. If anyone could help with the 3 questions, I’d greatly appreciate it!
I have a square, circle & triangle of a random size and positioning on the canvas, but as the last shape coded in the ‘void draw ()’ section is the triangle, it will always appear over the other two shapes. I want to somehow randomize the 3 shapes layering, as opposed to them always being layered in their coded sequence, is there a way to do this?
The 3 shapes have their own ‘fill’ color, but I actually want to randomly assign each of the colors to any one of the shapes (but only once each time.) Not sure how to do this.
My other issue is how to keep the shapes that are generated within the canvas area, instead of having half a circle in the canvas area and the other half off in no-where’s land?
Thanks in advance to anyone who can answer any/all of these questions, appreciate it!