// Esta vez utilizaremos floats para ganar un poco de precision float posY = 0; float velY = 0; // Tambien tendremos una gravedad que afectara la velocidad float gravY = 0.8; void setup(){ size(100,100); stroke(0); fill(0); smooth(); } void draw(){ // A cada frame // AƱadimos la gravedad a la velocidad velY += gravY; posY += velY; if ((posY >= height)){ velY = -velY; }else if(posY <= 0){ velY = -velY; } background(255); ellipse(width/2, posY, 10, 10); }