msg.post("#spriteTile", “play_animation”, { id = hash(“gem_”… self.tiletype) })
i used the line above to change the sprite of my tile sprite, which works perfectly while testing.
When I build on html5 and launch though, the sprites didn’t change, but it’s still playable.
Are there things about html5 builds that I need to take note of?
It depends on the data-type of self.tiletype in the above example. I assume it is a hash-value, which would in turn invoke tostring. Correctly reverse-hashing values back to their original string-value only works on dev-builds. As soon as you are running a release build, that feature is turned off since it consumes a bit of memory. String-manipulation should always be avoided in game-logic. The above example could be converted to a lookup table, which would be pre-calculated so you could do something like: