I keep getting this error with andengine when using a sprite sheet.
Can anyone explain what i means?
08-30 13:31:50.053: E/AndroidRuntime(9643): java.lang.ArrayIndexOutOfBoundsException: length=12; index=12
here is where the error is occuring at.
pItem.setCurrentTileIndex(MathUtils.random(0, pItem.getTileCount()));
My guess is that
MathUtils.randomis inclusive, which means that in your example (array of size 12), it will generate a number from 0 to 12, including 12. Try changing your code to: