The code example I was given is:
Actor actor = getOneObjectAtOffset(0, 0, clss);
if(actor != null) {
getWorld().removeObject(actor);
}
}
But when trying to use it, greenfoot said there were errors. Why?
Unless you assign some value to the variable 'clss', or replace it with the actual class that you are trying to get at that offset ('FishFoodPellets.class'), you will continue to get errors.
'actor' is a variable name. Leave that alone. You need to change 'clss' to 'FishFoodPellets.class', or whatever the name of the class is you are trying to eat.