SFML community forums

Help => General => Topic started by: Rietty on January 17, 2019, 07:23:45 pm

Title: Displaying a game tileset which includes animated components.
Post by: Rietty on January 17, 2019, 07:23:45 pm
Hi, so I was reading the SFML Vertex Array/Tileset articles and I understand them fairly well. But I had some concerns on how to implement/display a tilemap that can contain possible animated portions of a map. (Stuff like fountains on the walls, spikes on the floor, etc).

Right now I have a sprite animation class which is written like this:

https://github.com/Rietty/Hellcraft/blob/master/Animation.hpp
https://github.com/Rietty/Hellcraft/blob/master/Animation.cpp

And it works perfectly fine for my purposes.

What is the best way to animate different things on the map? Should I just include an empty tile in the tilemap/vertex array and then iterate over it later with an animated sprite? Is there a better way?

Any advice would be appreciated.
Title: Re: Displaying a game tileset which includes animated components.
Post by: DeathRay2K on January 17, 2019, 09:50:30 pm
The usual way is to do essentially as you said - static tiles in one layer, with animated objects rendered in a second pass.