How to store character moves (sprite animations)?
- by Saad
So I'm thinking about making a small rpg, mainly to test out different design patterns I've been learning about. But the one question that I'm not too sure on how to approach is how to store an array of character moves in the best way possible.
So let's say I have arrays of different sprites.
This is how I'm thinking about implementing it:
array attack = new array (10);
array attack2 = new array(5);
(loop)
//blit some image
attack.push(imageInstance);
(end loop)
Now every time I want the animation I call on attack or attack2; is there a better structure?
The problem with this is let's say there are 100 different attacks, and a player can have up to 10 attacks equipped. So how do I tell which attack the user has; should I use a hash map?