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

public class RollingCat : MonoBehaviour {

	public bool goForPlayer = false;
	[SerializeField] private float speed = 1;
	private CircleCollider2D coll;


	void Start(){
		coll = GetComponent<CircleCollider2D> ();
	}

	void Update () {
		if(goForPlayer){
			transform.position = new Vector3 (transform.position.x-speed,transform.position.y,transform.position.z);
			float angleInRads = speed / (coll.radius * Time.deltaTime);
			transform.Rotate(new Vector3(0,0,Mathf.Rad2Deg*angleInRads));

		}
	}

	void OnTriggerEnter2D(){
		//Kill TODO
		Debug.Log("Kill, RollingCat");
	}

}
