Hello!
A week has passed, a new problem ahead!
Heh, what I want to do is to have more animations looking exactly like eachother, but animationoff-sync. This is normally not a hard thing to do, but let me explain the state of my code.
I handle animations and pictures in what I think is a clever way. I have a resource manager that in a HashMap binds together Animations, and enums representing the animations.
So when I need an animation I can just refer to the enum, and get the animation from there when I need to actually draw it. This way I don’t have a lot of animations floating around on all kinds of objects, but just the enum references. I do the same for still images, where it’s obviously not a problem.
Because there is only 1 of each different animation (the one in the hashmap), it will be drawn on all entities that uses that animation. However, what do I do when I need two of the same animations side-by-side but they need to go at different pulses?
My scenario is this: The player walks in a huge field of high grass, and when he enters a new tile the grass on the tile is shaken because of the player walking in it. However, all of the grass uses the same images, and same animation so when one of the tiles are animated all of them are. That is unfortunate.
What do I do with my solution when I want these non-syncronized animations? I certainly do not want to force the animations directly on to the tiles.