we stuck on creating object on a random time but we put the default of coordinate. everytime press "run" it always creating the same object and it pile up . the object i use in this scenario is "coin" and "meteor".
the code on space :
The code on Controller :
this Mockup Game that i meant :

public class space extends World
{
public space()
{
this.addObject(new Controller(), 600, 80);
}
}public class Controller extends Actor
{
private int stepCounter;
private int randNum;
private nyan s;
public Controller()
{
GreenfootImage gfi = this.getImage();
gfi.clear();
this.setImage(gfi);
stepCounter = 0;
}
public void act()
{
stepCounter = Greenfoot.getRandomNumber(100);
World w = this.getWorld();
if ((stepCounter % 50 == 0)== true)
{
w.addObject(new koin(), 610, 55);
}
if ((stepCounter % 82 == 0)== true)
{
w.addObject(new koin(), 610, 155);
}
if ((stepCounter % 101 == 0)== true)
{
w.addObject(new koin(), 610, 255);
}
if ((stepCounter % 201 == 0)== true)
{
w.addObject(new koin(), 610, 355);
}
if ((stepCounter % 51 == 0) == true)
{
w.addObject(new meteor(), 610, 55);
}
if ((stepCounter % 70 == 0) == true)
{
w.addObject(new meteor(), 610, 155);
}
if ((stepCounter % 102 == 0) == true)
{
w.addObject(new meteor(), 610, 255);
}
if ((stepCounter % 200 == 0) == true)
{
w.addObject(new meteor(), 610, 355);
}
}
}