Java Applet - ArrayIndexOutOfBoundsException
Posted
by Dan
on Stack Overflow
See other posts from Stack Overflow
or by Dan
Published on 2010-05-30T05:27:19Z
Indexed on
2010/05/30
5:32 UTC
Read the original article
Hit count: 214
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.
© Stack Overflow or respective owner