I should first mention I have not actually done an Angry Birds like system, so this is mostly speculative.
For the two problems you mentioned, they both can be tackled using the center of the slingshot and moving the bird relative to the center of the slingshot.
Moving the bird is relatively simple. You first define the maximum radius the player can hold the bird at. Then you need to clamp the bird's position inside said radius. The basic pseudo code for that is as follows:
var mouse_pos = get_mouse_position()
var center_of_slingshot = get_node("slingshot/center").global_position
if ((mouse_pos - center_of_slingshot).length() < RADIUS):
get_node("bird").global_position = mouse_pos
else:
get_node("bird").global_position = (mouse_pos - center_of_slingshot).normalized() * RADIUS
That code should, in theory, keep the bird within slingshot's drag radius.
For applying force you need to use the center of the slingshot, do some math to make it point towards the bird, and then flip said vector so that it points away from the bird and use that to apply the impulse.
The pseudo code for that is as follows:
var center_of_slingshot = get_node("slingshot/center").global_position
var bird_direction = get_node("bird").global_position - center_of_slingshot
bird_direction = bird_direction.inverse()
get_node("bird").apply_impulse(Vector2(0, 0), bird_direction * EXTRA_FORCE)
That could should, in theory, fire the from the slingshot just like in Angry Birds. Because of how the bird_direction
vector is calculated, the farther the bird is away from the center of the slingshot, the higher bird_direction
should be which will make the impulse stronger.
Hopefully that helps give you some ideas on how to go about making a Angry Birds like firing system. As I said above, I have not actually made a Angry Birds like system before, so I'm making a educated guess on how you could make it work in Godot.