I wasn't sure whether to create a new topic for this - I know it's nice to have separate topics for different things despite them being related - but I'm asking a question based of someone's response to another question.

In AppleSauce's thread, he asked about how to do basic 2D animation in LWJGL. Now, in the past, I've always done this by having 1 texture (A strip) and timing how much time has gone past inbetween each frame. when this reaches the right amount, I change the 'viewing window' or the texture coordinates to the next frame - and I assumed this was standard.

But Drenius put this:

Quote

If you think you are fine, ok.Having a timer for every single texture in the program is a waste.Make it jump to the frame it has to be in when it is rendered when it is rendered.

Maybe I'm misunderstanding what was said, but from what I understand the method I'm using is a waste as I use multiple timers for each animation.

I don't understand what I should do instead - "Make it jump to the frame it has to be in when it is rendered" ??

I placed the second "when it is rendered" for a reason, also the second "when" was itallic for a reason.If you do not render a texture within a time span, you must not update it.You should just save when the last frame change took place and once you render the texture again, you can check how many frames must have passed since then and set it to that frame.

But the location that the sprite needs to be could change every frame, isn't it less complex to just render it each frame? Especially with a moving camera - or should I be keeping track or if I need to redraw it?

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org