using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class PlayerDamage : MonoBehaviour {
    private PlayerMovements playerMovements;
    [SerializeField] private GameManager gameManager;

    private void Awake() {
        playerMovements = GetComponent<PlayerMovements>();
    }

    private void OnCollisionEnter2D(Collision2D collision) {
        if (collision.gameObject.layer == 7) {
            if (playerMovements.hasBubble) {
                playerMovements.BurstBubble();
                gameManager.StartCountdown();
                gameManager.ChangeTheme();
            }
            else {
                //SceneManager.LoadScene("Main");
            }
        }
    }
}
