using Unity.VisualScripting;
using UnityEngine;

public class Spring : MonoBehaviour
{

    private AudioSource use;

    private void Start()
    {
        use = GetComponent<AudioSource>();
    }
    private void OnTriggerEnter2D(Collider2D collision)
    {
        Player player = collision.GetComponent<Player>();
        if (player != null)
        {
            player.rotationSpeed *= -1;
            use.pitch = Random.Range(0.95f, 1.05f);
            use.Play();
        }
    }
}
