Question
Processing Program Step 1. Design a static screen drawing using RGB colors and 5 circles. The diameters of the 5 circles are 20, 40, 60,
Processing Program
Step 1. Design a static screen drawing using RGB colors and 5 circles. The diameters of the 5 circles are 20, 40, 60, 80, and 100 pixels. You need to use a for loop to draw the 5 circles in a row from the smallest to the largest. The centers of the 5 circles need to be evenly distributed horizontally. The distance between two adjacent circles needs to be at least 100 pixels. The window size needs to be 600 x 600.
Step 2. Make the static screen drawing dynamic by having it interact with the mouse. This includes the following:
- The circles need to follow the mouse.
- The circles need to change their color according to the mouse.
Step 3. Add more dynamic features:
- When any key is pressed, your name and the date when the homework is done should be displayed in the console window.
- The background color should switch between black and white as the mouse is clicked. The background color should stay the same until the next time when the mouse is clicked. (Hint: you need to use a global boolean variable to control it.)
Here is some of the work I have. The circles are not moving with the mouse. Please help finish the whole problem. Thank you!
int d = 0; int endY = 100; int y = height/2;
void setup() { size(600, 600); background(51); ellipseMode(CENTER); }
void draw() { for (int xpos = 0; xpos < 600; xpos+= 100) { if (d < endY) { d += 20; ellipse(xpos + mouseX, y + mouseY, d, d); } } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started