﻿using UnityEngine;
using System.Collections;
using Assets.Scripts;

[RequireComponent(typeof(BoxCollider2D))]
[RequireComponent(typeof(SpriteRenderer))]
public class EnemyObject : MonoBehaviour {

	// Use this for initialization
	void Start () 
    {
        this.GetComponent<SpriteRenderer>().color = Color.red;
	}
	
	// Update is called once per frame
	void Update () {
	
	}

    public void OnCollisionEnter2D(Collision2D collision)
    {
        if (GetComponent<Collider>().tag.Equals("Player"))
        {
            GameManager.Initiates.Lose();
        }
    }

    public void OnCollisionExit2D(Collision2D collision)
    {

    }

    public void OnCollisionStay2D(Collision2D collision)
    {

    }


}
