// Variance int dia = 20; //diameter float posX = 10.0; //position X float posY = 10.0; //position Y float spdX = 0.5; //X speed float spdY = 0.0; //Y speed float GRAV = 9.8; //gravity int flagK = 0; //flag by keyboard void setup() { // Initialize size(200, 400); //window background(0, 0, 0); //black noStroke(); //lineless } void draw() { // main loop fill(0,0,0); //clear color rect(0, 0, width, height); //clear fill(0,128,255); //circle color if (flagK == 0) { //watch at flag ellipse(posX, posY, dia, dia); //circle } else { spdY += GRAV/60; // gravity posX += spdX; posY += spdY; if (posY >= height-dia/2) { spdY *= -1; //bound posY = height-dia/2; } ellipse(posX, posY, dia, dia); //circle } } void keyPressed() { if (key == ' ') { //space flagK = 1; //clear mode set } }