CSD Unit 3, stage 4, puzzle 17


#1

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!


#2

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;


#3

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


#4

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!


#5

Where do I find this puzzle 17?


#6

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