diff options
author | Logan <logan@cflip.net> | 2022-09-29 12:37:32 -0600 |
---|---|---|
committer | Logan <logan@cflip.net> | 2022-09-29 12:37:32 -0600 |
commit | 181f0aa422df02c14c9a4be9b59835661b3c5c07 (patch) | |
tree | 6981be84fb7d64c0f6d341433d4718b3ae63d4bf /scripts | |
parent | f6cd93bc976f58bd6f866e466364c5d608615d77 (diff) |
Added improvements to camera logic and zooming.
We'll probably want to refactor this at some point as it feels like it's
a pretty rough implementation, but it works and works well enough.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/camera.gd | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/camera.gd b/scripts/camera.gd index 264bc68..fb76159 100644 --- a/scripts/camera.gd +++ b/scripts/camera.gd @@ -2,3 +2,9 @@ extends Camera2D func _process(_delta): position = ($"../Basketball".position + $"../Hoop".position) / 2 + #if $"../Basketball".position.distance_to($"../Hoop".position) > limit_bottom: + #set_zoom(Vector2(1, 1) * ($"../Basketball".position.distance_to($"../Hoop".position) / limit_bottom)) + if ($"../Basketball".position.distance_to($"../Hoop".position) + $"../Basketball".drag_radius ) > limit_right: + set_zoom(Vector2(1, 1) * (($"../Basketball".position.distance_to($"../Hoop".position) + $"../Basketball".drag_radius) / limit_right)) + else: + set_zoom(Vector2(1, 1)) |