Q:

How to animate a character from a sprite sheet?

I'm making an online game, and I had been using a blank square as the character until recently. Now I want to add a real, animated character.
I downloaded a free sprite sheet which has 12 (3x4) character sprites.
What is the general method to animate the character?
I see why having all the character animations in one file can be useful, but I don't understand how it would be done. I don't want code or anything, I just want to know how you normally use the sprite sheet to animate a character so I code it afterwards.

A:

The answer to why to use a sprite-sheet has already been answered in this question.
How you use a sprite-sheet in your game is quite simple. Usually you have a class that keeps track of the elapsed time and displays another frame once a given threshold has been reached (eg. if 1/25th of a second has passed or similar).
How to display a new frame depends on your underlying graphics API. You might have to copy the new pixel data to a pixel-buffer, or modify UV coordinates of a quad, so that it shows another portion of the sprite-sheet.

