Watch FunProgramming [Video #9]
Here’s a program I wrote:
int xValue;
void setup()
{
size(400,400);
xValue = 0;
strokeWeight(25);
frameRate(1);
stroke(0);
}
void draw()
{
background(255);
point(xValue,200);
xValue = xValue + 25;
if (xValue > 400)
{
xValue = 0;
}
}
Change the program to move faster
Change the program to move diagonally.
Change the program so that the color of the point changes color as it goes across the screen,starting with a black spot on the left and finishing with a white spot on the right.
Like this:
Click on this image to view animation