An object called glass is moving upward at a certain speed, but I want it to gradually increase in speed. How would I do this?
Here is the code for my world
public class Darkness extends World
{
/**
* Constructor for objects of class Darkness.
*
*/
private int second = 0;
public Darkness()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(500, 500, 1);
addObject(new Marble(), 250, 150);
populateWorld();
}
public void started()
{
if (getObjects(Timer.class).isEmpty()) addObject(new Timer(), 250, 250);
}
public void populateWorld()
{
for ( int count = 0; count < 1; count++)
{
int x = Greenfoot.getRandomNumber (500);
int y = 450;
addObject (new Glass(), x, y);
}
}
public void act()
{
second++;
if (second == 9)
{
int x = Greenfoot.getRandomNumber (500);
int y = 450;
addObject (new Glass(), x, y);
second = 0;
}
}
}

