public void UpdateBitmask()
{
int count = 0;
if (Collidable && Top != null && Top.HeightType == HeightType)
count += 1;
if (Collidable && Right != null && Right.HeightType == HeightType)
count += 2;
if (Collidable && Bottom != null && Bottom.HeightType == HeightType)
count += 4;
if (Collidable && Left != null && Left.HeightType == HeightType)
count += 8;
Bitmask = count;
}