class Pelota{ float posY; float posX; float velY; float gravY; float radio; Pelota(float _posX, float _posY){ this.posX = _posX; this.posY = _posY; this.velY = 0; this.gravY = 0.8; this.radio = 5; } void actualizate(){ this.velY += this.gravY; this.posY += this.velY; if ((this.posY >= (height - this.radio))){ this.posY = height - this.radio; this.velY = -this.velY*0.9; } else if(this.posY <= 0 + this.radio){ this.posY = 0 + this.radio; this.velY = -this.velY*0.9; } } void dibujate(){ // Esta vez dibujaremos la pelota en su posicion X ellipse(this.posX, this.posY, this.radio*2, this.radio*2); } }