// Update is called once per frame
    void Update()
    {
        if (Input.GetButtonDown("A_P1") && hasJoined[1] == false)
        {
            hasJoined[1] = true;
            GlobalControl.AddPlayer(1);
            playerBlocks [GlobalControl.NumPlayers].GetComponent <SpriteRenderer> ().color = PlayerState.playerColor [GlobalControl.NumPlayers];
        }
        if (Input.GetButtonDown("A_P2") && hasJoined[2] == false)
        {
            hasJoined[2] = true;
            GlobalControl.AddPlayer(2);
            playerBlocks[GlobalControl.NumPlayers].GetComponent <SpriteRenderer>().color = PlayerState.playerColor [GlobalControl.NumPlayers];
        }
        if (Input.GetButtonDown("A_P3") && hasJoined[3] == false)
        {
            hasJoined[3] = true;
            GlobalControl.AddPlayer(3);
            playerBlocks[GlobalControl.NumPlayers].GetComponent <SpriteRenderer>().color = PlayerState.playerColor [GlobalControl.NumPlayers];
        }
        if (Input.GetButtonDown("A_P4") && hasJoined[4] == false)
        {
            hasJoined[4] = true;
            GlobalControl.AddPlayer(4);
            playerBlocks[GlobalControl.NumPlayers].GetComponent <SpriteRenderer>().color = PlayerState.playerColor [GlobalControl.NumPlayers];
        }

        if (GlobalControl.NumPlayers > 1)
        {
            startText.text = "Player 1 Press Start";
            if (GlobalControl.GetButtonDownStart(1))
            {
                PlayerState.playerType    = new PlayerType[5];
                PlayerState.playerType[1] = PlayerType.APPLE;
                PlayerState.playerType[2] = PlayerType.CARROT;
                PlayerState.playerType[3] = PlayerType.SAUSAGE;
                PlayerState.playerType[4] = PlayerType.STRAWBERRY;
                SceneManager.LoadScene("HotPotato");
            }
            if (GlobalControl.GetButtonDownBack(1))
            {
                PlayerState.easterEgg     = true;
                PlayerState.playerType    = new PlayerType[5];
                PlayerState.playerType[1] = PlayerType.APPLE;
                PlayerState.playerType[2] = PlayerType.CARROT;
                PlayerState.playerType[3] = PlayerType.SAUSAGE;
                PlayerState.playerType[4] = PlayerType.STRAWBERRY;
                SceneManager.LoadScene("HotPotato");
            }
        }
    }