Here is the part of the code that seems to cause the problem.
There's no need to guess as the exception stacktrace should tell you exactly which line causes the exception. If you post a similar problem, you will want to indicate to us which line is causing the problem, here it is at Board.checkCollisions(Board.java:185)
, or line 185 of Board.java.
This code looks suspicious:
for(int i = 0; i < bunkers.size(); i++){
Bunker b = (Bunker) bunkers.get(i);
if(b.isVisible() == false){
bunkers.remove(i);
}
}
You're removing an item from a list while iterating forward through it -- something you should not do since it will often cause an AIOOBE like you're seeing. Consider iterating backwards through the collection.