CSD Unit 3, stage 4, puzzle 17

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!

1 Like

Hi Susan,
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:

// Sunset
background(color(red, 100, blue));
red = red + 1;
blue = blue - 1;

//Night
background(color(0, 0, 0, opacity));
opacity = opacity +1;

2 Likes

Hi @susan.honsinger,

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.

Best,

Dani

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!

1 Like

Where do I find this puzzle 17?

This is in reference to an old version of the course @laura.paczewitz. Things have been updated in response to feedback since this set of posts.

-Dani