public int xVel = Greenfoot.getRandomNumber(3) + 1;
public int yVel = Greenfoot.getRandomNumber(3) + 1;
public void act(){
if (getY() <= 0)
{
yVel = yVel * -1;
}
if (getX() <= 25 || getX() >= getWorld().getWidth()-25)
{
xVel = xVel * -1;
}
}
public void move()
{
setLocation(getX() + xVel, getY() + yVel);
}
public void moveup(){
setLocation(getX() + xVel, getY() - yVel);
}
how do you make the speed variable with this code i have that it bounces with the edges of the world but not that the speed changes with each bounce. can you help me?

