public void boost()
        {
            GameObject playerObject;

            playerObject = GetGlobalObjects.getControllablePlayer();
            StartCoroutine(PlayerBehaviors.activateSpeedBoost(playerObject));
        }
Exemple #2
0
        /// <summary>
        /// Interpret user input per update.
        /// </summary>
        void FixedUpdate()
        {
            if (SceneManager.GetActiveScene().name == GlobalTags.GAME_SCREEN)
            {
                if (isLocalPlayer)
                {
                    int input = InputController.Instance.update();

                    if (input == InputConstants.INPUT_BOOST)
                    {
                        StartCoroutine(PlayerBehaviors.activateSpeedBoost(gameObject));
                    }
                    else if (input == InputConstants.INPUT_LEFT)
                    {
                        PlayerBehaviors.turnPlayer(gameObject, InputConstants.INPUT_LEFT);
                    }
                    else if (input == InputConstants.INPUT_RIGHT)
                    {
                        PlayerBehaviors.turnPlayer(gameObject, InputConstants.INPUT_RIGHT);
                    }
                }
            }
        }
 /// <summary>
 /// Starts a coroutine to speed boost an AI player.
 /// </summary>
 /// <param name="player">The player to be boosted</param>
 public void boostAIPlayer(GameObject player)
 {
     StartCoroutine(PlayerBehaviors.activateSpeedBoost(player));
 }