REQUIREMENTS
Your dream house
It can be anything: a mansion, castle, moon base, or secret volcano lair
Features
You must include a ground and sky in the background that change color at night
You must include a sun (day), and crescent moon (night)
You must include a house with at least six distinct elements
Ex: Windows, Doors, Roof, Lava Moat
Multiple copies of the same thing are still one element
Interaction
While the user has the mouse button pressed, the entire image should change to show that it is night time.
The sun should be replaced with the moon
The colors should become darker
You might have some elements change in other ways (optional)
Ex: Stars might come out, lights pop on in the windows, etc...
Code
Your code should have comments above each section showing which parts are drawing each element
At the very list, comments for grass/sky/moon and each of the 6 elements
Video Resources
Most projects will simply list the things to complete, not the resources we'll use.
But to get you started, a quick reminder that you'll want to watch these two videos before you dig into this project:
Watch Shiffman "Variables" (1:29 to 1:53)
Watch Shiffman "Conditionals" (2:02 to 2:28)
We won't use variables a ton, but they're helpful to understand conditionals. All of that content will be needed for the next project and first Coding Quiz though, so make sure you take your time with it.
Using Conditionals
In this project, we won't use the mousePressed() method. This would require us to make two copies of the entire program essentially!
Instead, we are going to use conditionals and the built-in variable mousePressed when we set the color for each element. See the example below to draw the grass during night and day.
void draw()
{
// Grass
if(mousePressed)
{
fill(0, 255, 0);
}
else
{
fill(0, 150, 0);
}
rect(0, 550, width, height-500);
}
FAQ / Tips
How do I draw a crescent moon?
You'll need to use two overlapping shapes.
If one is the color of the sky....