using UnityEngine;
using System.Collections;

public class Pacdot : MonoBehaviour {

    public AudioClip sfx;
    void OnTriggerEnter2D(Collider2D co) {
        if (co.tag == "Player")
        {
            //Debug.Log ("Pellet Eaten");

            //Play SoundFX here, add to score, track if PacVan wins, etcetera
            transform.parent.gameObject.SendMessage("LostChild");

            if (sfx != null)
            {
                AudioSource.PlayClipAtPoint(sfx, transform.position);
            }
            
            Destroy(gameObject);
        }
    }
}