Learn creative coding writing simple programs

97. Interacting with many rectangles (I)

This time we create five arrays to store information about a collection of rectangles. The five arrays are used to store the color and the left, top, right and bottom borders of each rectangle.
By storing this information in arrays we can draw those rectangles as many times as we want, and also calculate if the mouse is inside or outside of each rectangle.
No new concepts are introduced this time. Episode 98 continues where this one ends.

Tags: interactive, rectangle, mouse, over, array, collection

Code editor

You can make changes to the code below. Then
Below you can ask and answer questions related to this video. If your question is unrelated to the video, please post it at the Processing Forum as I'm unable to help with all of your programs and still have enough free time to eat and sleep :)
comments powered by Disqus