title: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
body: <p>Trying to find out were I'm going wrong with this piece of code as I receive ArrayIndexOutOfBoundsExceptions on this line <code>.elementAt(spriteIdx);</code>. Thanks for the tip.</p>
  
  <p>Jason</p>
  
  <pre><code>Play = new Sprite[8][13];
          for (int i = 0; i &lt; 8; i++) {
              for (int j = 0; j &lt; 13; j++) {
                  int spriteIdx = map.getInt(String.format("play-%d-%d", i, j));
                  if (spriteIdx != -1) {
                      Play[i][j] = (Sprite) savedSprites
                              .elementAt(spriteIdx);
  </code></pre>