player_camera.gd 179 B

123456789
  1. class_name PlayerCamera
  2. extends Camera2D
  3. # Track the player
  4. const SPEED_TO_ZOOM = 0.001
  5. func _on_moved(speed: float) -> void:
  6. zoom = Vector2.ONE / (1 + speed * SPEED_TO_ZOOM)