using UnityEngine;
using System.Collections;

public class CocaPepsaLife : MonoBehaviour {

	public Sprite hp0, hp1, hp2, hp3, hp4, hp5, hp6, hp7, hp8, hp9, hp10;
	SpriteRenderer sr;
	int counter;

	// Use this for initialization
	void Start ()
	{
		sr = this.gameObject.GetComponent<SpriteRenderer> ();
		sr.sprite = hp0;
		sr.enabled = true;
		counter = 0;
	}
	
	// Update is called once per frame
	void Update ()
	{
		switch (counter)
		{
		case 0:
			sr.sprite = hp0;
			break;
		case 1:
			sr.sprite = hp1;
			break;
		case 2:
			sr.sprite = hp2;
			break;
		case 3:
			sr.sprite = hp3;
			break;
		case 4:
			sr.sprite = hp4;
			break;
		case 5:
			sr.sprite = hp5;
			break;
		case 6:
			sr.sprite = hp6;
			break;
		case 7:
			sr.sprite = hp7;
			break;
		case 8:
			sr.sprite = hp8;
			break;
		case 9:
			sr.sprite = hp9;
			break;
		case 10:
			sr.sprite = hp10;
			break;
		case 11:
			counter = 0;
			break;
		}
	}

	public void LoseLife()
	{
		counter++;
	}

	public void LoseFiveLife()
	{
		counter += 5;
	}
}
