sound settings set on start + smoother zoom (and holding works)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user