I tend to use typed arrays for my sprites - one of the array elements is a timer for the animation - and the current frame - and then a seperate array holding frames or ranges of frames for each "type" of character the sprites represent - for example, I could have 10 monsters but they all use the same animation frames, but one player - so I would have two sets of animation in this case.
Example would be :
Type Monsters
X As Integer
Y As Integer
Action As Integer
Frame As Integer
SpriteNumber As Integer
AnimateTimer As Integer
EndType
Dim Monsters(number of monsters) As Monsters
<program loop here>
For Monster = 1 To number of monsters
Sprite Monsters(Monster).SpriteNumber, Monsters(Monster).X, Monsters(Monster),Y, Monsters(Monster).Frame
If Timer() > Monsters(Monster).AnimateTimer
If Monster(Monster).Action = 1
Rem
Rem Running
Rem
Monsters(Monster).Frame = <new frame>
Monsters(Monster).AnimateTimer = Timer() + 200
Endif
Endif
Next Monster
You could extend this further and have either a typed array for animation frames, or use #CONSTANTS to put labels on the frames or frame ranges :
#CONSTANT Run_Left_Start = 100
#CONSTANT Run_Left_End = 110
#CONSTANT Run_Right_Start = 111
#CONSTANT Run_Right_End = 120
e.t.c.
In the case of several sprites which have their own animation frames typed arrays could be useful :
Type AnimationFrames
Run_Left_Start As Integer
Run_Left_End As Integer
Run_Right_Start As Integer
Run_Right_End As Integer
EndType
Dim AnimationFrames(10) As AnimationFrames
AnimationFrames(1).Run_Left_Start = 101
AnimationFrames(1).Run_Left_End = 110
AnimationFrames(1).Run_Right_Start = 111
AnimationFrames(1).Run_Right_End = 120
AnimationFrames(2).Run_Left_Start = 121
AnimationFrames(2).Run_Left_End = 130
AnimationFrames(2).Run_Right_Start = 131
AnimationFrames(2).Run_Right_End = 140
For Monster = 1 To number of monsters
Sprite Monsters(Monster).SpriteNumber, Monsters(Monster).X, Monsters(Monster),Y, Monsters(Monster).Frame
If Timer() > Monsters(Monster).AnimateTimer
If Monsters(Monster).Action = 1
Rem
Rem Running
Rem
If Monsters(Monster).Frame < AnimationFrames(1).Run_Left_Start
Monsters(Monster).Frame = AnimationFrames(1).Run_Left_End + 1
Endif
If Monsters(Monster).Frame > AnimationFrames(1).Run_Left_End
Monsters(Monster).Frame = AnimationFrames(1).Run_Left_Start
Endif
Monsters(Monster).Frame = Monsters(Monster).Frame + 1
If Monsters(Monster).Frame > AnimationFrames(1).Run_Left_End
Monsters(Monster).Frame = AnimationFrames(1).Run_Left_Start
Endif
Endif
Monsters(Monster).AnimateTimer = Timer() + 200
Endif
Next Monster
I have used this technique in a game I am developing at the moment - basically I name all my animation frames and reference them by label name instead of having to remember numbers - the numbers are of course assigned to the frame names in a routine called early on in the game - it's no faster than knowing frames but it makes your programs a lot easier to maintain and if an animation sequence changes in number of frames you only need to change them once in the program instead of going through the program looking for the places where the frame numbers are used.
I am not sure whether this helps you or not - we all have our own way of writing programs.