Edit: IDKW, but in the formula I typed below the site removed my asterisks. It should be a * 1 + b * 2 etc but when I omit the space, it removes the *.

I can’t say i understand the code but the formula where it seems to be converting from binary to decimal doesn’t look right. I apologize if I’m making the wrong assumption.

Is it missing variables e and g?

If this is meant to be a binary conversion then the sequence would be a1 +b2 +c4 + d8 + e16 + f32 + g64 +h128 (this is just the formula, you would need to add the Variable() )

I looked at the link some more and I understand a little. I still think e and g are needed.

For 8-bit masking it seems like you need to convert the number before assigning the animation.

Under “Tile Order” is says

"Another problem you may notice is that the values calculated by the 8-bit bit masking procedure no longer correlate to the sequential order of the tiles in the sprite sheet. There are only 48 tiles, but our possible calculated values range from 0 to 255, so we can no longer use the calculated value as a direct reference when grabbing the appropriate sprite. What we need, therefore, is a data structure to contain the list of calculated values and their corresponding tile values. How you want to implement this is up to you, but remember that the order in which you check for surrounding tiles dictates the order in which your tiles should be placed in the sprite sheet. "