using UnityEngine;
using System.Collections;

public class JumpSheep : MonoBehaviour 
{
    public bool CanJump = false;
    public AudioSource JumpSFX;
	// Update is called once per frame
	void Update () 
    {
        if (Input.GetKeyDown(KeyCode.UpArrow))
        {
            if (CanJump)
            {
                JumpSFX.Play();
                gameObject.GetComponent<Rigidbody>().AddForce(Vector3.up * 1600f);
                CanJump = false;
            }
        }
	}


    void OnCollisionEnter(Collision Col)
    {
        if (Col.gameObject.tag == "Ground")
            CanJump = true;
    }

}
