using UnityEngine;
using System.Collections;

public class Menu : MonoBehaviour 
{
	public Transform bolinha;
	public AudioSource changeSound;
	// Use this for initialization
	void Start () 
	{
	
	}
	
	// Update is called once per frame
	void Update () 
	{
		if (Input.GetKeyDown("down"))
		{
			if (bolinha.position == new Vector3(-5.4f, -0.4f, 0f))
			{
				bolinha.position = new Vector3(-5.4f, -2.4f, 0f);
				if (!changeSound.isPlaying)
					changeSound.Play();
			}
			else if (bolinha.position == new Vector3(-5.4f, -2.4f, 0f))
			{
				bolinha.position = new Vector3(-5.4f, -4.0f, 0f);
				if (!changeSound.isPlaying)
					changeSound.Play();
			}
			else if (bolinha.position == new Vector3(-5.4f, -4.0f, 0f))
			{
				bolinha.position = new Vector3(-5.4f, -0.4f, 0f);
				if (!changeSound.isPlaying)
					changeSound.Play();
			}
		}

		if (bolinha.position == new Vector3(-5.4f, -4.0f, 0f) && Input.GetButton("Jump")) 
		{
			Application.LoadLevel(2);
		}

		if (bolinha.position == new Vector3(-5.4f, -2.4f, 0f) && Input.GetButton("Jump"))
		{
			Application.LoadLevel(3);
		}

		if (bolinha.position == new Vector3(-5.4f, -0.4f, 0f) && Input.GetButton("Jump")) 
		{
			Application.LoadLevel(1);
		}
	}
}
