Tilengine - The 2D retro graphics engine forum

Full Version: Tile animation (ON/OFF switch case)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I have some questions about tile animations.

I am trying to make an ON/OFF switch gimmick like what you can find in Super Mario Maker 2 :


In my case, the state of the switch is stored in a Boolean variable.
The best way to achieve this effect I think is through animations. However, I can't find a way to control animations to achieve this effect.
The way I achieved the gimmick is by iterating through THE ENTIRE TILEMAP and change the index of the tiles I want to switch, so, very unoptimized.

Do you know how I can achieve that?
Thanks for your answer!
Hi!
I'm out on holidays now, but I'll consider it after I return. Right now there's no direct way to achieve the effect you want. It would require two new calls:
1. Query a tileset to get a list of handles of its built-in animations
2. Add an enable/disable animation call