1
Programming / Re: BearLibTerminal: a pseudo-terminal window library for roguelike
« on: January 18, 2017, 10:22:21 PM »Quote from: KittyTristyWell, I was wondering Cfyz.. do you plan to add support for animated tiles? I have a game I'm working on with drawn tiles and I'd really love to have them be animated. I couldn't see any way to do this currently, so do point out if I'm wrong here.Yep, there is no support for that right now. If you need animations you have to loop and redraw manually =/.
I've thought (still thinking?) about animated tiles and the biggest obstacle is that library does not know anything about the objects in a scene. It might be okay for something nailed to a screen but if you try to move/scroll things, the mapping is lost. The animation is either twitching (if cell changes restart it) or continuing in the wrong place (if some cells move simultaneously and the new content is indistinguishable from the previous one at the same coordinates). The only one that looked fine in my mockups is a very simple several-frames simultaneous animation like in DawnLike tileset.
Thanks for your response!
After reading your reply, much to my own surprise I managed to get animation working with a very minor change to my code. Basically in the code each object in a scene keeps track of the character that represents itself. For some of my objects, this is now a list with multiple characters, and in the draw code, if it sees that it's a list instead of a single character, it chooses a random entry in that list and uses that to draw with on the current redraw call. It allows for only simple two or three frame animation (something like Ultima 5 for example) but that's precisely what I was going for!
I'm going to need to make some tweaks for animations that need to be consistent (such as water tiles) but I definitely wasn't expecting to be able to get animations working so soon, so I'm quite pleased.
Thanks again for your reply because it inspired me to poke at my code and get animation working.