To view this content, you need to install Java from java.com

Source code: spooky_rect

Built with Processing

//spooky rect by paul glennon

float myColour; // Need to check what this means!!!
int x = -80; // I think this sets the start point out of the stage.
void setup(){ // void means returns no value.
size(300,200);
background(0);
framerate(10); // frames per second.
}
void draw(){
myColour = random(1,255);
background(0);
rect(x,50,50,100);
fill(myColour,0,0);
x=x+4;
}

No. 3
spooky_rect
by paul glennon 2005

Simple movement with a random colour to make a 'spooky' effect when traveling from one side of the screen to the other.

Note the equation x=x+4. Play around with this and change the speed (also with the framerate).