using UnityEngine;
using System.Collections;

public class RepeatGuitar : MonoBehaviour {

    int positionCount = 0;
    public GameObject fireBall;

	// Use this for initialization
	void Start () {
        
    }
	
	// Update is called once per frame
	void Update () {
	
	}

    public void GuitarMakeBeat()
    {
        ++positionCount;
        float xCoord = 0f;
        switch (positionCount) {
            case 0:
                xCoord = 0;
                break;
            case 1:
                xCoord = -1.25f;
                break;
            case 2:
                xCoord = 1.25f;
                positionCount = -1;
                break;
            default:
                Debug.Log("Error: Guitar has a broken string");
                break;
        }
        Vector3 spawn = gameObject.transform.position + new Vector3(xCoord, 0f, 0f);
        Instantiate(fireBall, spawn, Quaternion.identity);
        
    }

   
}
