function set_floortex_obj_yplat() { if (!variable_instance_exists(id, "force_yplat") || !force_yplat) { if (variable_instance_exists(id, "walltex")) { if (instance_exists(walltex)) { if (walltype == 1) y_plat = floortex.bbox_bottom_plat + walldist; if (walltype == 2) y_plat = floortex.bbox_top_plat + walldist; if (variable_instance_exists(id, "y_plat_offset")) y_plat += y_plat_offset; exit; } } if (instance_exists(floortex)) { var _spr = sprite_index; var _h = sprite_get_height(_spr); var _yorigin = sprite_get_yoffset(_spr); var _ALIGNMENT = 0; var _y_ow = y_ow; if (ignore_yorigin) { _ALIGNMENT = 1; } else if (_yorigin == round(_h / 2)) { _ALIGNMENT = 0; _y_ow += (sprite_height / 2); } else if (_yorigin > round(_h / 2)) { _ALIGNMENT = 1; } else { _ALIGNMENT = -1; _y_ow += sprite_height; } var _scale = 0.1; var _ydist = _y_ow - floortex.y_ow; if (!variable_instance_exists(id, "force_yplat") || !force_yplat) { y_plat = floortex.y_plat + (_ydist * _scale); switch (_ALIGNMENT) { case -1: y_plat -= sprite_height; break; case 0: y_plat -= (sprite_height / 2); break; case 1: break; } } } } if (variable_instance_exists(id, "y_plat_offset")) y_plat += y_plat_offset; }