diff --git a/playable/Assets/Scenes/Level1.unity b/playable/Assets/Scenes/Level1.unity index 8c61705..badc80e 100644 Binary files a/playable/Assets/Scenes/Level1.unity and b/playable/Assets/Scenes/Level1.unity differ diff --git a/playable/Assets/Scenes/Menu_Scene.unity b/playable/Assets/Scenes/Menu_Scene.unity index 07267a9..072fc4c 100644 Binary files a/playable/Assets/Scenes/Menu_Scene.unity and b/playable/Assets/Scenes/Menu_Scene.unity differ diff --git a/playable/Assets/Scripts/levelController.cs b/playable/Assets/Scripts/levelController.cs index 3e5cdb8..f45e1f2 100644 --- a/playable/Assets/Scripts/levelController.cs +++ b/playable/Assets/Scripts/levelController.cs @@ -6,6 +6,10 @@ public class levelController : MonoBehaviour { public int playerCount; public int maxScore; public int confetti; + public bool p1Enabled; + public bool p2Enabled; + public bool p3Enabled; + public bool p4Enabled; public static levelController control; diff --git a/playable/Assets/Scripts/menuContrller.cs b/playable/Assets/Scripts/menuContrller.cs index ea76365..84dd040 100644 --- a/playable/Assets/Scripts/menuContrller.cs +++ b/playable/Assets/Scripts/menuContrller.cs @@ -9,6 +9,7 @@ public class menuContrller : MonoBehaviour { public GameObject levelSelect; public GameObject instructions; public GameObject xboxLayout; + public GameObject btn_1player; public GameObject btn_2player; public GameObject btn_3player; public GameObject btn_4player; @@ -19,14 +20,46 @@ public class menuContrller : MonoBehaviour { public GameObject platypuss; public GameObject goat; public GameObject kangaroo; + private bool p1Enabled = false; + private bool p2Enabled = false; + private bool p3Enabled = false; + private bool p4Enabled = false; // Use this for initialization void Start () { - + control = GameObject.FindGameObjectWithTag ("GameController").GetComponent (); + } // Update is called once per frame void Update () { + + if (Input.GetAxisRaw ("Vertical_P1") == 1) { + Debug.Log("button hit"); + p1Enabled = true; + btn_1player.GetComponent ().color = Color.green; + + } + + if (Input.GetAxisRaw ("Vertical_P2") == 1) { + p2Enabled = true; + btn_2player.GetComponent ().color = Color.green; + + } + + if (Input.GetAxisRaw ("Vertical_P3") == 1) { + p3Enabled = true; + btn_3player.GetComponent ().color = Color.green; + + } + + if (Input.GetAxisRaw ("Vertical_P4") == 1) { + p4Enabled = true; + btn_4player.GetComponent ().color = Color.green; + + } + + } public void panelSelect (string panel){ @@ -68,24 +101,35 @@ public class menuContrller : MonoBehaviour { } public void playerSelect (int players){ - btn_2player.GetComponent ().color = Color.grey; - btn_3player.GetComponent ().color = Color.grey; - btn_4player.GetComponent ().color = Color.grey; control.playerCount = players; - if (players == 2) - btn_2player.GetComponent ().color = Color.red; - if (players == 3) - btn_3player.GetComponent ().color = Color.red; - if (players == 4) - btn_4player.GetComponent ().color = Color.red; + if (players == 1) { + btn_1player.GetComponent ().color = Color.green; + p1Enabled = true; + } + if (players == 2) { + btn_2player.GetComponent ().color = Color.green; + p2Enabled = true; + } + if (players == 3) { + btn_3player.GetComponent ().color = Color.green; + p3Enabled = true; + } + if (players == 4) { + btn_4player.GetComponent ().color = Color.green; + p4Enabled = true; + } } public void levelStart (string level){ - + control.p1Enabled = p1Enabled; + control.p2Enabled = p2Enabled; + control.p3Enabled = p3Enabled; + control.p4Enabled = p4Enabled; + Application.LoadLevel (level); } diff --git a/playable/Assets/sceneController.cs b/playable/Assets/sceneController.cs index 90ef430..8dc0aa0 100644 --- a/playable/Assets/sceneController.cs +++ b/playable/Assets/sceneController.cs @@ -40,20 +40,12 @@ public class sceneController : MonoBehaviour { void Start () { control = GameObject.FindGameObjectWithTag ("GameController").GetComponent (); - player1.SetActive (false); - player2.SetActive (false); - player3.SetActive (false); - player4.SetActive (false); - - playerCount = control.playerCount; - if (playerCount >= 1) - player1.SetActive (true); - if (playerCount >= 2) - player2.SetActive (true); - if (playerCount >= 3) - player3.SetActive (true); - if (playerCount >= 4) - player4.SetActive (true); + player1.SetActive (control.p1Enabled); + player2.SetActive (control.p2Enabled); + player3.SetActive (control.p3Enabled); + player4.SetActive (control.p4Enabled); + + playerScript1.maxScore = control.maxScore; playerScript2.maxScore = control.maxScore;