Functions, and their ability to run small chunks of code over and over again, are really useful to animate
something more complicated than a single pixel. Why? Because we can use the function to draw a more complicated
shape (like a person or car), then just use the function in a for-loop during the repeated drawing and erasing.
Now you try. Try fixing the for and color statements to make a pixel move.
Type your code here:
See your results here:
This code will not run. You have to fix the for x= for-loop to count over the screen positions that you want
your pixel to move over (try starting at -100 and moving to 100). Your step size for this count will control
the speed of the pixel. Next, select a color for which the pixel should be drawn in the color() line.
Share your code
Show a friend, family member, or teacher what you've done!