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

public class MainMenu : MonoBehaviour {
	public AudioClip[] music;
	GUIStyle msgStyle = new GUIStyle();
	GameController gc;
	public Sprite[] invImages;
	public Font font;
	public AudioClip titleTrack;

	void Start () {
		msgStyle.normal.textColor = Color.white;

		msgStyle.alignment = TextAnchor.MiddleCenter;
		msgStyle.font = font;

		gc = GameController.instance;
		gc.audio.clip = titleTrack;
		gc.audio.loop = true;
		gc.audio.Play ();
	}
	
	// Update is called once per frame
	void Update () {
		if(Input.GetButtonDown("Interact")){

			GameController.font = font;
			GameController.ageAudio.Clear ();
			for(int i=0; i<4;i++){
				GameController.ageAudio.Add((Age) i,music[i]);
			}
			GameController.invImages.Clear ();
			for(int j=0; j<12;j++){
				GameController.invImages.Add((items) j,invImages[j]);
			}
			Application.LoadLevel("Intro");
		
		}
	}

	void OnGUI(){
		msgStyle.fontSize = 45;
		GUI.Label(new Rect(0,100,Screen.width,Screen.height/2), "These Walls That Surround Me",msgStyle);
		msgStyle.fontSize = 20;
		GUI.Label(new Rect(0,-100+Screen.height/2,Screen.width,Screen.height/2), "Left and right arrow keys to move\n" +
		          "Space to interact\n" +
		          "\nSpace to start",msgStyle);

	}
}
