(solved) LibGDX 2D Sprite Animation

Hi everyone. I’m very new to LibGDX and I wanted to test out sprite animations so here’s what I have:

http://pastebin.com/yq4cECi1

It pretty much just divides up the default badlogic.jpg into 64x64 sprites. I’ve looked around online and it seems my implementation is pretty standard.
However, when I run it, the animation doesn’t change frames and only the first frame renders. Why???

Hopefully this is a very simple mistake and I just messed up a parameter or two.

Thanks!

Your variable

ANIM_DELAY

is way too high of a number. I believe 1 = 1 second, so you are delaying each frame switch by 1000 seconds right now. Try changing it to be lower, that should solve your issue!

Damn, I need to read the javadoc more often. I was so used to using milliseconds for animation delays. Thank you!

Yep, for whatever reason it takes seconds, even although the game loop thinking mechanism is based around milliseconds. But odd imo, you might want to do it in milliseconds anyway and convert it, for accuracy.