Slick2D: Animation not being parsed from spritesheet correctly

Posted by user2066880 on Game Development See other posts from Game Development or by user2066880
Published on 2014-03-13T23:03:05Z Indexed on 2014/06/13 9:44 UTC
Read the original article Hit count: 345

Filed under:
|
|
|

I have a 960x960 spritesheet with each tile being 192x192. I initialized my spritesheet and animation like so:

spritesheet = new SpriteSheet("resources/spritesheets/player.png", 192, 192);
walkingLeft = new Animation(spritesheet, 3, 0, 0, 1, true, 20, true);

When I attempt to render the animation, I get a java.lang.ArrayIndexOutOfBoundsException: -1 error. This error doesn't occur when I'm creating an animation from images in the same row. Therefore, I'm assuming that the error is being caused because of the way Slick is handling horizontal scanning (going to the next row after reaching the end).

© Game Development or respective owner

Related posts about java

Related posts about animation