I have a student working through Unit 3 solo, with a little help from me. We are both stumped by the opacity challenge here, and I would love to know what a solution looks like!
The way I did this was to approach it by drawing two separate background. The first is your normal sunset, transitioning from blue to orange as ‘red’ increases and ‘blue’ decreases. The second background is black and drawn after the first. It starts invisible with an initial ‘opacity’ value of 0. As ‘opacity’ increases, the black area becomes less transparent. Here’s a snippet of my code:
background(color(red, 100, blue));
red = red + 1;
blue = blue - 1;
background(color(0, 0, 0, opacity));
opacity = opacity +1;
There are actually Example Solutions of most of the levels in Unit 3 in the Teacher Panel (see image below):
If you can’t see the Example Solution button in the teacher panel its because you need to become a Verified Teacher account. You can apply for that here.
Harvey, Dani - thanks so much. My student and I were able to finish the challenge using opacity thanks to your hints, Harvey. Dani, I have filled out the form for verified teacher status!
Where do I find this puzzle 17?