A program that draws your dream home and changes from day to night.
You will use your skills from the first tutorial and the resources above to create an interactive drawing of your dream house. This could be a luxury mansion, a medieval castle, or a hidden volcano lair. When the user holds down the mouse button, it should turn from day to night.
Requirements:
- Include setup() and draw() methods
- Use an if / else statement
- By default, it is day time.
- While clicked, it becomes night.
- Draws your dream home with at least six distinct details. Examples include:
- Doors
- Windows
- Roof
- Grass
- Steps
- Lava
- Day shows a bright sky and a sun
- Night shows a dark sky and a moon.
- Decide what you would like to draw
- Think of six details that are pretty easy to make using simple shapes
- Plan It Out! What order does it make the most sense to draw things in?
- For instance, you might have a background you're going to draw a bunch of stuff on top of... you can overlap! Draw that stuff first.
- What's going to be different between day and night?
- At the very least, the instructions say the sky and moon must change.
- Group your elements into three camps:
- Day Only
- Night Only
- All The Time
- Start coding! Write your setup() and draw() methods
- Where should you be putting your art? In setup() or draw()? Why?
- Divide your program into an if / else based on mouse press
- Put your "night only" stuff inside the "if" block
- Put your "day only" stuff in the "else" block
- Put your all the time stuff outside of both blocks (but inside the method)
- Add a little, run it and test, revise, repeat until complete!
SAMPLE END OF UNIT QUIZ