Zzimon wrote...
yeah the class would be quite easy but the rest of the code still has to be altered to use the last actor
public void prepare()
{
for (int row=0; row<getHeight(); row++) for (int col=0; col<getWidth(); col++)
{
Actor actor = null;
while (!canPlace(actor, col, row))
{
int which = Greenfoot.getRandomNumber(3);
if(which == 0) actor = new Sword();
if(which == 1) actor = new Coin();
if(which == 2) actor = new Torch();
}
addObject(actor, col, row);
}
}private List<Tile> getHorizontalMatchingTiles(int x, int y)
List<Tile> list = new ArrayList();
import java.util.List.*; import java.util.ArrayList.*;