using UnityEngine;
using System.Collections;

public class PlayerTouch_S : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		References.Set("player health", health);
	}
	
	float health = 100f;
	
	public void EnterFlower(Flower_S flower){
		if(health < 100f){
			flower.TakeDamage(0.3f);
			health += 0.3f;
			}

	}
	
	void OnTriggerEnter(Collider other) {
		other.gameObject.SendMessage("EnterPlayer", this, SendMessageOptions.DontRequireReceiver);	
	}
	
	public AudioClip damageClip;
	public void TakeDamage(float damage){
		health -= damage;
		audio.clip = damageClip;
		audio.Play();
		if(health < 0){
			GUIScript.Die();
		}
	}
	
}
