I want to animate tilemaps in my game at runtime to avoid creating more sprites (tiny ones at that) and cluttering my project by doing so. This also makes it easier to alter levels quickly.
I've achieved this goal but the method is only effective when the tilemaps are relatively small (referring to the amount of tiles that are currently painted on the map in editor) because the function plugs in a parameter for the 1st and last tile UID in the animation and use nested For Loops for checking the entire tilemap every time the function is called. Since the animation frame have to change every x seconds this bogs down the device quite a bit. A bit being 30 FPS...
I figured For Loops were probably a bad choice for something like this but I couldn't figure out any other way to do it so far.
I think this would be WAY more effective if I could access the tilemap as a JSON then find the tile UID(s) I'm comparing in the function and then, if the conditions are met, use the replace expression to replace those UID(s) with itself +1.
Here's a screenshot of my current event sheet.
Does anyone know how I might do what is directly above this question or maybe something even more efficient?
Thanks in advance!