In my world I creates a number of objects randomly in the world. I am doing this for 2 different Actors in different ways, so i though a method would simplify things. However I am having trouble passing an actor as a parameter.
Here is the method I have so far.
Here I call the method.
public void createThingsRandLocal(int num, Actor object)
{
for (int i = 0; i < num; i = i + 1)
{
int xSpawn = Greenfoot.getRandomNumber(600);
int ySpawn = Greenfoot.getRandomNumber(400);
addObject(object, xSpawn, ySpawn);
}
}
createThingsRandLocal(100, Food)

