Some background info before I explain my problem.
In my world I have 3 methods to check how close the moving object (person) is to a section of a large grid. The level 3 method is active when the object is within 100m a certain grid square and rechecks it every 5-6 seconds (to help with lag). If they are closer than 100m it passes up to Level 2 which checks more often and finally to Level 1. In the Level 1 method, if the object is inside the certain grid square, it retrieves the pre-built (during loading) list of objects within that square (not that simple). It runs a different Level 3 method and works its way up to level 1 where it will stop the moving object from bumping into the stationary object.
The problem that I am having is that in the second set of methods, I have If statements to determine if the object is still in the same grid. They look like this:
Basically:
If the object is still in the same grid
Continue with collision detection
Else
Do Nothing
When it reaches the do nothing stage (moving into a different grid), Alice throws:
java.lang.ArrayIndexOutOfBoundsException: 2
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.childPrologueIfNecessary(DoInOrder. java:51)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.update(DoInOrder.java:97)
at edu.cmu.cs.stage3.alice.core.response.CallToUserDe finedResponse$RuntimeCallToUserDefinedResponse.upd ate(CallToUserDefinedResponse.java:86)
with heaps more lines and sometimes throws an overflow error.
I have attached my world but when loaded you need to wait for ready to appear in the text console. I will fix this later with a loading bar as well as the grids are visible and the colision barriers are visible.
Really appreciate all help with this.