Basically what I want to do is check an area in my world, if that area does not have an wall already in it, it will spawn a dot.
PrepX and PrepY = 0. My world is 21 x 21. PrepX and PrepY are the coordinates of the tile I am trying to check.
The following code runs in my constructor method in my world class:
What happens is that it doesnt spawn any dots. If I change (w ==null) to (w!=null), it spawns dots everywhere, including underneath the walls which is what I do not want, I have no clue why it even spawns the dots, im not very familiar with lists. What am I doing wrong?
public void makeDots()
{
for(int TimesRan = 0; TimesRan < 441; TimesRan++){
PrepX++;
if(PrepX == 21){PrepX = 0; PrepY++;}
List w = (List)getObjectsAt(PrepX,PrepY,Wall.class);
if(w == null) {addObject(new Dot(), PrepX,PrepY);}
}
