Part 1-

Review Learning Processing, Chapter 5

Review the class notes here


Create the following sketch and EMAIL ME YOUR CODE: cehiggins@citytech.cuny.edu
(You can send a link to your openProcessing URL, attach the .pde file to the email, or copy and paste you code into the email)

Step 1. Create variables to hold onto red, green, and blue color components. Call them r, g, and b.

Step 2. Continuously draw the background based on those colors.

Step 3. Draw lines to separate your sketch window into 4 even quadrants.

Step 3. If the mouse is on the top right corner of the screen, increment the value of r, otherwise decrement it.

**Hint- for the mouse to be in the top right corner of the screen, mouseX has to be greater than half the width  AND  mouseY has to be less than half the height

Step 4. If the mouse is on the top left corner of the screen, increment the value of g, otherwise decrement it.

Step 5. If the mouse is on the bottom left corner of the screen, increment the value of b, otherwise decrement it.

Step 6. Constrain the value r, g, and b to be within 0 and 255.

What’s the only way to make the screen black?? Explain how and why in your email to me.

Part 3-

Take the “bouncing ball” logic and create a new sketch that incorporates incrementing and decrementing variables, such as changing the size, color, and location of a shape based on certain conditions. Incorporate mousePressed or keyPressed (the boolean variables, not the functions). Upload your sketch to openProcessing and post your sketch’s URL to the blog. 

Leave a Reply

Your email address will not be published.