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

public class BombScript : MonoBehaviour {

	private Animator anim;
	private int state = 0; // 0-> idle; 1->exploding; 2->exploded;
	private SpriteRenderer sr;

	void Start () {
		anim = GetComponent<Animator> ();
		sr = GetComponent<SpriteRenderer> ();
	}
	
	void Update () {
	}

	private void OnTriggerEnter2D(Collider2D col){
		if(col.tag.Equals("Player")){
		if (state == 0) {
			anim.SetInteger ("Animation", 1);
			state = 1;
			//Kill
			Debug.Log("Kill, BombScript");
		}
	}
	}

	void flipY(){
		sr.flipY = true;
	}

}
