public override void Draw()
        {
            BattlegroundController.BgView.Draw(BattlegroundController.BgModel.Bounds);

            BattlegroundController.FirstFighterHealth.Draw(BattlegroundController.FirstFighter.Health.ToString());
            BattlegroundController.SecondFighterHealth.Draw(BattlegroundController.SecondFighter.Health.ToString());

            BattlegroundController.DrawFighter(BattlegroundController.FirstFighterActions, BattlegroundController.FirstFighter, BattlegroundController.SecondFighter);
            BattlegroundController.DrawFighter(BattlegroundController.SecondFighterActions, BattlegroundController.SecondFighter, BattlegroundController.FirstFighter);
        }
Пример #2
0
    void Start()
    {
        GameObject obj = GameObject.FindGameObjectWithTag(Tags.BattlegroundController);
        if (obj == null) {
            Debug.LogError("ERROR: coulndt find tag Battleground Controller");
        } else {
            controller = obj.GetComponent<BattlegroundController>();
            setUp();

            Invoke(() => {
                movement.SetUp(target);
            }, startDelay);
        }
    }
Пример #3
0
 void Awake()
 {
     locomotion = GetComponent<AvatarLocomotion>();
     controller = GameObject.FindGameObjectWithTag(Tags.BattlegroundController).GetComponent<BattlegroundController>();
 }
Пример #4
0
 void Start()
 {
     controller = transform.parent.GetComponent<BattlegroundController>();
 }
Пример #5
0
    void Awake()
    {
        controller = GameObject.FindGameObjectWithTag(Tags.BattlegroundController).GetComponent<BattlegroundController>();

        if (controller.avatar.gun != null) {
            Destroy(controller.avatar.gun.gameObject);
        }
        controller.avatar.gun = this;
        transform.SetParent(controller.avatar.gunPivot);
        transform.ResetTransform();
        bulletParent = controller.bulletParent;

        currentBulletsInCartridge = bulletsPerReload;
        feedback = transform.parent.GetComponent<GunFeedback>();
    }
        private void HandleUserInput()
        {
            KeyboardState keyboardState = Keyboard.GetState();

            if (keyboardState.IsKeyDown(Keys.Up) && !this.previousKeyboardState.IsKeyDown(Keys.Up) &&
                !this.DonationScreenDisplayed && !this.ControlsScreenDisplayed)
            {
                this.ActiveButtonIndex--;

                if (this.ActiveButtonIndex >= 0)
                {
                    AudioController.PlaySound(AudioController.MenuClickInstance);
                }

                if (this.ActiveButtonIndex < 0)
                {
                    this.ActiveButtonIndex = 0;
                }
            }

            if (keyboardState.IsKeyDown(Keys.Down) && !this.previousKeyboardState.IsKeyDown(Keys.Down) &&
                !this.DonationScreenDisplayed && !this.ControlsScreenDisplayed)
            {
                this.ActiveButtonIndex++;

                if (this.ActiveButtonIndex <= TotalButtonsCount - 1)
                {
                    AudioController.PlaySound(AudioController.MenuClickInstance);
                }

                if (this.ActiveButtonIndex > TotalButtonsCount - 1)
                {
                    this.ActiveButtonIndex = TotalButtonsCount - 1;
                }
            }

            if (keyboardState.IsKeyDown(Keys.Enter) && !this.previousKeyboardState.IsKeyDown(Keys.Enter))
            {
                if (this.ActiveButtonIndex == 0)
                {
                    BattlegroundController.Initialize();

                    InputController.Initialize();

                    PlazaSmashGame.SM.ChangeState();

                    AudioController.StopSound(AudioController.MenuMusicInstance);
                }
                else if (this.ActiveButtonIndex == 1)
                {
                    if (!this.DonationScreenDisplayed)
                    {
                        AudioController.PlaySound(AudioController.MenuClickInstance);
                        this.DonationScreenDisplayed = true;
                    }
                    else
                    {
                        AudioController.PlaySound(AudioController.MenuClickInstance);
                        this.DonationScreenDisplayed = false;
                    }
                }
                else if (this.ActiveButtonIndex == 2)
                {
                    if (!this.ControlsScreenDisplayed)
                    {
                        AudioController.PlaySound(AudioController.MenuClickInstance);
                        this.ControlsScreenDisplayed = true;
                    }
                    else
                    {
                        AudioController.PlaySound(AudioController.MenuClickInstance);
                        this.ControlsScreenDisplayed = false;
                    }
                }
                else if (this.ActiveButtonIndex == 3)
                {
                    AudioController.PlaySound(AudioController.MenuClickInstance);
                    EntryPoint.Game.Exit();
                }
            }

            this.previousKeyboardState = keyboardState;
        }