sound settings set on start + smoother zoom (and holding works)

This commit is contained in:
Altaezio
2026-07-21 11:04:47 +02:00
parent 2b98447b41
commit bc77604fc9
2 changed files with 15 additions and 7 deletions
+7 -3
View File
@@ -17,10 +17,14 @@ const ZOOM_STEP = 0.1
var shake_noise := FastNoiseLite.new()
func _input(_e):
if Input.is_action_just_pressed("zoom_in"):
if Input.is_action_pressed("zoom_in"):
if settings.zoom < zoom.x: # was zooming out
settings.zoom = (zoom.x / ZOOM_STEP) * ZOOM_STEP
settings.zoom = settings.zoom + ZOOM_STEP
GameInfo.save_settings()
if Input.is_action_just_pressed("zoom_out"):
if Input.is_action_pressed("zoom_out"):
if settings.zoom > zoom.x: # was zooming in
settings.zoom = (zoom.x / ZOOM_STEP) * ZOOM_STEP
settings.zoom = settings.zoom - ZOOM_STEP
GameInfo.save_settings()
@@ -33,7 +37,7 @@ func _process(delta):
if following and should_follow:
global_position = following.global_position.lerp(global_position, MOVE_LERP_WEIGHT)
zoom = zoom.lerp(Vector2.ONE * settings.zoom, MOVE_LERP_WEIGHT)
zoom = zoom.lerp(Vector2.ONE * settings.zoom, ZOOM_LERP_WEIGHT)
if shake_active_time > 0.:
shake_active_time -= delta