Exemplo n.º 1
0
 private void DisplayChoice(GameChoices choice)
 {
     if (choice == GameChoices.Fire)
     {
         GameImages.DrawFire(10, 10);
     }
 }
Exemplo n.º 2
0
 private void DisplayChoice(GameChoices choice)
 {
     if (choice == GameChoices.Scissors)
     {
         GameImages.DrawScissors(10, 10);
     }
 }
    public void SetChoices(GameChoices gameChoices)
    {
        SetOpponentChoice();

        switch (gameChoices)
        {
        case GameChoices.BRACE:
            playerChoice_Img.sprite = brace_Sprite;
            player_Choice           = GameChoices.BRACE;
            break;

        case GameChoices.RELOAD:
            playerChoice_Img.sprite = reload_Sprite;
            player_Choice           = GameChoices.RELOAD;
            ammo.ammo++;
            break;

        case GameChoices.FIRE:
            playerChoice_Img.sprite = fire_Sprite;
            ammo.ammo--;
            player_Choice = GameChoices.FIRE;
            break;
        }
        DetermineOutcome();
    }
Exemplo n.º 4
0
    public void GetChoice()
    {
        string choiceName = UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject.name;

        print("Player Selected: " + choiceName);

        GameChoices selectedChoice = GameChoices.NONE;

        switch (choiceName)
        {
        case "Brace":
            selectedChoice = GameChoices.BRACE;
            break;

        case "Reload":
            selectedChoice = GameChoices.RELOAD;
            break;

        case "Fire":
            selectedChoice = GameChoices.FIRE;
            animationController.playerShipFireAnimation();
            break;
        }

        gameplayController.SetChoices(selectedChoice);
        animationController.PlayerMadeChoice();
        StartCoroutine(RestartAnimation());
    }
Exemplo n.º 5
0
 public Player(string name, GamePlayers PlayerType)
 {
     this.Name       = name;
     this.PlayerType = PlayerType;
     Score           = 0;
     Choice          = GameChoices.None;
 }
    public void GetChoice()
    {
        string choiceName = UnityEngine.EventSystems.
                            EventSystem.current.currentSelectedGameObject.name;

        GameChoices selectedChoice = GameChoices.NONE;

        switch (choiceName)
        {
        case "Sword":
            selectedChoice = GameChoices.SWORD;
            break;

        case "Shield":
            selectedChoice = GameChoices.SHIELD;
            break;

        case "Spell":
            selectedChoice = GameChoices.SPELL;
            break;
        }

        gameplayController.SetChoices(selectedChoice);
        animationController.removeButtons();
        //animationController.showButtons();
    }
Exemplo n.º 7
0
    public void SetChoices(GameChoices gameChoices)
    {
        switch (gameChoices)
        {
        case GameChoices.ROCK:

            playerChoice_Img.sprite = rock_Sprite;
            player_Choice           = GameChoices.ROCK;
            break;

        case GameChoices.PAPER:

            playerChoice_Img.sprite = paper_Sprite;
            player_Choice           = GameChoices.PAPER;
            break;

        case GameChoices.SCISSORS:

            playerChoice_Img.sprite = scissors_Sprite;
            player_Choice           = GameChoices.SCISSORS;
            break;
        }
        SetOpponentChoice();
        DetermineWinner();
    }
    public void SetChoices(GameChoices gameChoices)
    {
        switch (gameChoices)
        {
        case GameChoices.SWORD:
            CarlChoice            = GameChoices.SWORD;
            CarlChoice_Img.sprite = sword_sprite;                // Set Img.sprite to sword sprite
            break;

        case GameChoices.SHIELD:
            CarlChoice            = GameChoices.SHIELD;
            CarlChoice_Img.sprite = shield_sprite;
            break;

        case GameChoices.SPELL:
            CarlChoice            = GameChoices.SPELL;
            CarlChoice_Img.sprite = spell_sprite;
            break;
        }



        setGregChoice();
        DetermineWinner();
    }
Exemplo n.º 9
0
    public void GetChoice()
    {
        string choiceName = UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject.name;

        print("Player selected: " + choiceName);

        GameChoices selectedChoice = GameChoices.NONE;

        switch (choiceName)
        {
        case "Rock":
            selectedChoice = GameChoices.ROCK;
            break;

        case "Paper":
            selectedChoice = GameChoices.PAPER;
            break;

        case "Scissors":
            selectedChoice = GameChoices.SCISSORS;
            break;
        }

        gameplayController.SetChoices(selectedChoice);
        animationController.PlayerMadeChoice();
    }
    private void SetChoice(GameChoices gameChoices, ref GameChoices playerChoice)
    {
        switch (gameChoices)
        {
        case GameChoices.ROCK:
            playerChoice = GameChoices.ROCK;
            break;

        case GameChoices.PAPER:
            playerChoice = GameChoices.PAPER;
            break;

        case GameChoices.SCISSORS:
            playerChoice = GameChoices.SCISSORS;
            break;
        }
    }
Exemplo n.º 11
0
    private GameChoices SelectedChoice()
    {
        GameChoices selectedChoice = GameChoices.NONE;

        switch (_inputController._choiceName)
        {
        case "Rock":
            selectedChoice = GameChoices.ROCK;
            break;

        case "Paper":
            selectedChoice = GameChoices.PAPER;
            break;

        case "Scissors":
            selectedChoice = GameChoices.SCISSORS;
            break;
        }

        return(selectedChoice);
    }
Exemplo n.º 12
0
    //* Idk, but maybe this is where choices are set. */
    public void SetChoices(GameChoices gameChoices)
    {

        switch (gameChoices)
        {

            case GameChoices.ROCK:

                /* //! In this case, an image is switched out to represent the player's
                ! choice.  */
                playerChoice_Img.sprite = rock_Sprite;

                player_Choice = GameChoices.ROCK;

                break;

            case GameChoices.PAPER:

                playerChoice_Img.sprite = paper_Sprite;

                player_Choice = GameChoices.PAPER;

                break;

            case GameChoices.SCISSORS:

                playerChoice_Img.sprite = scissors_Sprite;

                player_Choice = GameChoices.SCISSORS;

                break;

        } // switch / case

        SetOpponentChoice();

        DetermineWinner();

    }
    public void SetChoicePlayerTwo(GameChoices gameChoices)
    {
        SetChoice(gameChoices, ref _playerTwoChoice);

        CheckForWin();
    }
 public void SetChoicePlayerOne(GameChoices gameChoices)
 {
     SetChoice(gameChoices, ref _playerOneChoice);
 }
Exemplo n.º 15
0
 private void DisplayChoice(GameChoices choice)
 {
     throw new NotImplementedException();
 }
    public void SetChoices(GameChoices gameChoices)
    {
        switch (gameChoices)
        {
        case GameChoices.ROCK:
            playerChoice_Img.sprite = rock_Sprite;
            player_Choice           = GameChoices.ROCK;
            break;

        case GameChoices.PAPER:
            playerChoice_Img.sprite = paper_Sprite;
            player_Choice           = GameChoices.PAPER;
            break;


        case GameChoices.SCISSORS:
            playerChoice_Img.sprite = scissors_Sprite;
            player_Choice           = GameChoices.SCISSORS;
            break;
        }


        {
            SetrakipChoice();

            DetermineWinner();

            void SetrakipChoice()
            {
                int rnd = Random.Range(0, 3);

                switch (rnd)
                {
                case 0:
                    rakipChoice            = GameChoices.ROCK;
                    rakipChoice_Img.sprite = rock_Sprite;
                    break;

                case 1:
                    rakipChoice            = GameChoices.PAPER;
                    rakipChoice_Img.sprite = paper_Sprite;
                    break;

                case 2:
                    rakipChoice            = GameChoices.SCISSORS;
                    rakipChoice_Img.sprite = scissors_Sprite;
                    break;
                }
            }

            void DetermineWinner()
            {
                if (player_Choice == rakipChoice)
                {
                    infoText.text = "It's a draw!";

                    StartCoroutine(DisplayWinnerAndRestrat());
                    return;
                }
                if (player_Choice == GameChoices.PAPER && rakipChoice == GameChoices.ROCK)
                {
                    //player won

                    infoText.text = "You Win!";

                    StartCoroutine(DisplayWinnerAndRestrat());
                    return;
                }
                if (rakipChoice == GameChoices.PAPER && player_Choice == GameChoices.ROCK)
                {
                    //rakip won

                    infoText.text = "You Lose!";

                    StartCoroutine(DisplayWinnerAndRestrat());
                    return;
                }
                if (player_Choice == GameChoices.ROCK && rakipChoice == GameChoices.SCISSORS)
                {
                    //player won

                    infoText.text = "You Win!";

                    StartCoroutine(DisplayWinnerAndRestrat());
                    return;
                }
                if (rakipChoice == GameChoices.ROCK && player_Choice == GameChoices.SCISSORS)
                {
                    //rakip won

                    infoText.text = "You Lose!";

                    StartCoroutine(DisplayWinnerAndRestrat());
                    return;
                }
                if (player_Choice == GameChoices.SCISSORS && rakipChoice == GameChoices.PAPER)
                {
                    //player won

                    infoText.text = "You Win!";

                    StartCoroutine(DisplayWinnerAndRestrat());
                    return;
                }
                if (rakipChoice == GameChoices.SCISSORS && player_Choice == GameChoices.PAPER)
                {
                    //rakip won

                    infoText.text = "You Lose!";

                    StartCoroutine(DisplayWinnerAndRestrat());
                    return;
                }
            }

            IEnumerator DisplayWinnerAndRestrat()
            {
                yield return(new WaitForSeconds(2f));

                infoText.gameObject.SetActive(true);
                yield return(new WaitForSeconds(2f));

                infoText.gameObject.SetActive(false);
                AnimationController.ResetAnimations();
            }
        }
    }