Hello all. I am working on a top-down view 2d game at the moment and I am learning a ton about sprites and sprite handling. My question is how to handle a set of sprites that can be rotated in as many as 32 directions.
At the moment a given object has its sprite sheet with all of the animations oriented with the object pointing at 0 degrees at all times. Now, since the object can rotate in as many as 32 directions, what is the best way to work with that original sprite sheet. My current best guess is to have the program basically dynamically create 32 more sprite sheets when the object is first loaded into the game, and then all subsequent instances of that type of object will share those sprite sheets.
Anyways, any advice in this regard would be helpful. Let me know if I need to rephrase the question, I know its kindof an odd one. Thanks
Edit: I guess for more clarification. If I have, for instance an object that has 2 animations of 5 frames a peice, that is a pretty easy sprite sheet to create and organize, its a simple 2x5 grid (or 5x2 depending on how you lay it out). But the problem is that now those 2 animations have to be rotated in 32 directions. This means that in the end there will be 320 individual sprites. I am going to say that (and correct me if im wrong) since I'm concerned about performance and frame-rate, rotating the sprites on the fly every single frame is not an option. So, how should these 320 sprites that make up these 2 animations be organized? Would it be better to
- Think of it as 32 2x5 sprite sheets
- split the sprite sheet up into individual frames, and then have an array the 32 different directions per frame (so 10 arrays of 32 directional sprites)
- Other....?
- Doesn't matter?
Thanks