Hi all, my game has different surfaces such as grass, rock, metal etc and I am wanting to play different footsteps as the character runs across these.
My levels are large, varied and are primarily built using tilemaps so my first thought was to create a colour coded tilemap placed underneath my collision tiles and check if the player is overlapping a particular index in that and then play the sounds as needed. I like this method because I can just paint in areas and they will match up easily with my artwork. I haven't put it into practice yet, but it got me thinking - is that actually the best way to do this?
I would have to constantly be looping through the tilemap indexes right? Or would I simply be saving myself time if I had several sprites and stretched them as needed across areas and then made them invisible at runtime? Would this be more or less performant? Does anyone have any experience or insights on the best way to do this from both a performance and maintenance perspective, bearing in mind that we are dealing with large layouts here. I realise for small projects the performance difference may be inconsequential. Thanks for any guidance!