Added coordinate clamp on level collision and tile type