Attack animation
Closed this issue · 4 comments
The game crashes when an attack occurs as no animation frames have been provided.
We need to port the Attack animation to the new structure. (I guess it will be a sequence of animation elements similar to move I tried to make the code in the area flexible for possible future extensions)
I've tried messing with this but I'm having some difficulties since there are two units than need to be drawn during the animation at the same time.
Also I've noticed that constantly converting from images to textures introduces a slight lag in animations.
Just a thought - what if we completely ditched drawing in images and then converting them to textures and instead we do everything with textures only? That means that map will be drawn texture-tile by tile on the map panel. Similarly a texture of unit will be drawn and then shield texture on top, etc. That should make animations easier to do.
I've actually tried to do something similar to this in Main.Draw.cs.
I think I tried that initially with every tile being its own texture the frame rate was not good.
I think for units, sheilds, etc caching the textures would solve this problem. After all all spearman look the same and all shiends for a civ look the same. If we were to add an additional offset to account for the shield position it shouldn't be hard to use cached textures for that. The animation elements should be an array of items to render so rendering shield then health then unit should get what we want.
I don't have the code in front of me right now as I'm travelling but will look at it later in the week.
Shall I look into refactoring the unit code to use Cached Textures? I think I need this for the supported units and Units here for cities as well.
Are you working in this area?
Yes you can do that, I'm currently working on TOT saves.