We are about to switch to a new forum software. Until then we have removed the registration on this forum.
could someone help me get started on this project?
Make a row of 20 squares. Make their fill colour gradually change from white to black, slowly over time.
Now make them go back to white, slowly over time.
Now make it look as though the change occurs as a "wave" of white moving through the row of boxes, from left to right (and then wraps). (If this sounds weird, don't worry, I'll explain at the board.)
CHALLENGE: Now, instead of a single row, make it a 20x20 grid of squares! The "ripple" propagates through the grid, one row at a time: left to right in row 1, then right to left in row 2, etc. This is called "serpentining", for reasons which may or may not be obvious :)
Answers
make a basic sketch with setup() and draw()
make a for-loop and paint rects in a row
i got this what should be the next code?
Make their fill colour gradually change from white to black,
use a variable to do so
color myFill = color (0);
you need a function
draw()
(as I have written before)and have the for-loop in
draw()
use
background(0);
at the beginning ofdraw()
just read the assignment and make it step by step...
to format your code in your post properly:
go back, edit your post
leave 2 empty lines before and after
select the code
hit ctrl-o
come back when you have a question
;-)
the tasks
we discussed - the var starts with 255 and gets
--
. All rects same color.when it becomes zero instead of
--
use++
; can you think of a better way? Once we add -1, once we add 1. All rects same color.Now, All rects different color. Store color in an array, each rect has it's own color. Start it off with different colors like 0,10,20....
"serpentining" is what a road does that goes up a steep mountain. Hint: to fill the grid use a double (nested) for-loop.
;-)