Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

How does an organization know if it is pursuing optimal strategies?

Answered: 1 week ago

Question

is particularly relevant to these issues.)

Answered: 1 week ago

Question

Explain walter's model of dividend policy.

Answered: 1 week ago