using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
public class GameManager : MonoBehaviour
{

    [SerializeField] private TextMeshProUGUI scoreText; // Score text UI

    public int score = 10; // Start met 10

    // Start is called once before the first execution of Update after the MonoBehaviour is created
    void Start()
    {
        scoreText.text = "Score: " + score; // zet tekst
    }

    public void AddScore(int amount)
    {
        score += amount; // Voeg score toe

        scoreText.text = "Score: " + score; // Zet tekst

        if (score < 0)
        {
            SceneManager.LoadScene(0);
        }
    }
}
