Java Applet - ArrayIndexOutOfBoundsException
- by Dan
OK so I am getting an ArrayIndexOutofBoundsException. I don't know why.
Here's my code: http://www.so.pastebin.com/y5MjD1k3
The thing is when I go to the red brick at board[2][2]... I go there. Then I go up... then I TRY go to back down but that error pops up. Also when I go to the right 8 squares... I ALSO get that error.
ALSO, pretend my 2d map is split into FOUR squares... well square one is the top left... if I go ANYWHERE else ... I get that error.
What am I doing wrong? Thanks.