extends Camera2D

@export var randomStrength: float = 30.0
@export var randomRotationStrength: float = 5.0
@export var shakeFade: float = 5.0

@export var intensity: float = 0.0

var rng = RandomNumberGenerator.new()
var shake_strength: float = 0.0

var initialPos: Vector2


func _ready():
	initialPos = offset

func _process(delta):
	offset = initialPos + randomOffset() * intensity
	rotation = randomRotation() * intensity

func randomOffset() -> Vector2:
	return Vector2(rng.randf_range(-randomStrength, randomStrength), rng.randf_range(-randomStrength, randomStrength))

func randomRotation() -> float:
	return deg_to_rad(randf_range(-randomRotationStrength, randomRotationStrength))
