//Float is a variable type that holds decimals. It full name is "floating point" float x; //The x position of the block float y; //The y position of the block float speedy; //The speed of the block in the Y direction //Setting initial Values void setup(){ size(640,480); x = 200; y = 250; speedy = 1; } void draw(){ //Draw the background fill(0); rect(0,0,640,480); //Draw the block fill(255); rect(x,y,50,20); //Gravity--- OPTIONAL // speedy += 0.1; //Make the block use its speed y = y + speedy; //Check to bounce off the bottom if(y > 480){ speedy *= -1; //Flip the sign of the current speed to reverse direction } //Check to bouce off the top if(y < 0){ speedy *= -1;//Flip the sign of the current speed to reverse direction //speedy = speedy * (-1); Cause its the same as above } } //More on this later... void keyPressed(){ print(keyCode + " "); }