// METHODS private void GetHeroPosition() { x_distacne = movingControl.GetPosition().x - position.x; y_distacne = movingControl.GetPosition().y - position.y; if (x_distacne >= 0) { heroSide = "right"; } else { x_distacne = -x_distacne; heroSide = "left"; } }
private void SetHeroPosition() { x_distance = movingControl.GetPosition().x - x_cameraPosition; y_distance = movingControl.GetPosition().y - y_cameraPosition; if (x_distance > 0) { x_direction = "right"; } else { x_direction = "left"; x_distance = -x_distance; } if (y_distance > 0) { y_direction = "up"; } else { y_direction = "down"; y_distance = -y_distance; } }