if (_bullet_marker == -4) exit; if (!_bullet_active) exit; if (_fade_out) { var is_complete = false; var target_x = _target_pos.x; var target_y = _target_pos.y; with (_bullet_marker) { image_alpha = scr_movetowards(image_alpha, 0, 0.1); scr_obj_movetowards_point(target_x, target_y, 8); if (image_alpha <= 0) is_complete = true; } if (is_complete) stop(); } else { var bullet_distance = point_distance(_bullet_marker.x, _bullet_marker.y, _target_pos.x, _target_pos.y); var target_x = _target_pos.x; var target_y = _target_pos.y; if (bullet_distance <= 20) { with (_bullet_marker) { image_alpha = scr_movetowards(image_alpha, 0, 0.4); scr_obj_movetowards_point(target_x, target_y, 8); } if (_bullet_marker.image_alpha <= 0) _bullet_active = false; } else { with (_bullet_marker) { image_alpha = scr_movetowards(image_alpha, 1, 0.2); scr_obj_movetowards_point(target_x, target_y, 8); } } }