Originally posted by Leeman_s
Say I have one big bitmap with all the diff. pictures for a guy walking, or i had all diff. bitmaps for it. Either way, I'm wondering if this would work:

I could declare an integer whose value is 10, and decrement it each time the user hits the key that moves the guy. then when i draw the guy to the screen, i check where the int is at and then put it in a switch statement and depending what it is it will display one of the states of the walking position. and when it gets to zero, reset it to 10. (assuming there are 10 diff walking positions). is this a way to do it or is there something more efficient?
Depends on how complex animations you have. I usually have an integer holding which animation frame it is, then using an algorithm to get the proper picture from the bitmap, ie:
Code:
RECT r;
r.x = AnimationFrame * PLAYER_WIDTH;
r.y = AnimationNumber * PLAYER_HEIGHT;
r.width = PLAYER_WIDTH;
r.height = PLAYER_HEIGHT;
Where AnimationFrame is which frame is currently showing (in the animation) and AnimationNumber is the current animation (ie: Stand, Walk, Jump, etc...) and r is the part of the bitmap that will be painted.

The bitmap is made so that each animation type (stand, jump...) has their own row, and on each row there are several frames to that animation.
This way, you don't need to use switch:es, thus making your code nicer.