I have been messing around with the idea of way-points to be implemented into a game at a later date. I have almost all of the code working but am running to some crashes that I am not sure how to fix.The board is held in a 2D array of tiles, each of which can be clicked on. Clicking on one will save a waypoint in a linkedlist. The seeker (little ball) will move from it's current position to the next waypoint, then keep finding waypoints until it is at the end of the waypoint list.
My problem is that after the first cycle of waypoints, the program crashes with an index out of bounds error. It works for any number of waypoints, but once it reaches the final one, I get an error. I am not sure how to go about fixing this. If anyone could help me find it or suggest a better way to go about this (or both) I'd be very thankful.