Beispiel #1
0
        private void InitializeSpriterGui()
        {
            _spriterFile["EndGamePanel"].AnimationFinished += EndGamePanel_AnimationFinished;

            // End game panel buttons
            var closePanelButton = new SpriterGuiButton(
                Game.ViewportAdapter, "CloseBossPanel", "Graphics/GUI/GameScreen/game-panel-close-button.png",
                _spriterFile["CloseButton"], _spriterFile["EndGamePanel"], "Idle", null, "Audio/SE/select4"
                );

            var retryPanelButton = new SpriterGuiButton(
                Game.ViewportAdapter, "StartBattleBossPanel", "Graphics/GUI/GameScreen/game-panel-retry-button.png",
                _spriterFile["RetryButton"], _spriterFile["EndGamePanel"], "Idle", null, "Audio/SE/select2"
                );

            closePanelButton.Action += EndGamePanelCloseButtonAction;
            retryPanelButton.Action += EndGamePanelRetryButtonAction;

            closePanelButton.Animator().ZIndex(11);
            retryPanelButton.Animator().ZIndex(11);

            _endGamePanelButtons.Add(closePanelButton);
            _endGamePanelButtons.Add(retryPanelButton);

            _skipButton = new SpriterGuiButton(
                Game.ViewportAdapter, "SkipButton", "Graphics/GUI/GameScreen/skip-button.png",
                _spriterFile["SkipButton"], _spriterFile["GameScreen"], "Idle", null, "Audio/SE/select2", null, false, "skip-button"
                );

            _skipButton.Action += SkipButtonAction;

            // GUI
            _endGameTitleLabel        = new SpriterGuiLabel("", Assets.GetFont("Graphics/Fonts/ui-title"), "end-game-panel-title-label.png", _spriterFile["EndGamePanel"], Vector2.Zero, true);
            _endGameDeathCounterLabel = new SpriterGuiLabel("", Assets.GetFont("Graphics/Fonts/ui"), "end-game-panel-player-deaths-label.png", _spriterFile["EndGamePanel"], Vector2.Zero, true);
            _endGameTauntLabels       = new List <SpriterGuiLabel>();

            _endGamePanelLabels.Add(_endGameTitleLabel);
            _endGamePanelLabels.Add(_endGameDeathCounterLabel);
        }
Beispiel #2
0
        protected override void InitializeSpriterGui()
        {
            Animators["BossSelection"].AnimationFinished += BossSelectionScreen_AnimationFinished;
            Animators["BossPanel"].AnimationFinished     += BossPanel_AnimationFinished;

            Animators["Ball"].zIndex(9);
            Animators["Garland"].zIndex(5);
            Animators["BossPanel"].zIndex(10);

            // Christmas tree's balls
            foreach (var bossName in _bossNames)
            {
                var ballAnimator = Animators["Ball"].Clone();
                ballAnimator.Play("Balance");
                ballAnimator.Progress = (float)Game.GameManager.Random.NextDouble();
                ballAnimator.Speed    = 0.5f + (float)Game.GameManager.Random.NextDouble();

                var hasRelation = _bossRelations.ContainsKey(bossName);

                if (hasRelation)
                {
                    _bossGarlands.Add(new SpriterSubstituteEntity(
                                          "xmas-" + _bossRelations[bossName].Item1 + "-" + bossName + "-garland.png",
                                          Animators["BossSelection"], Animators["Garland"].Clone()
                                          ));

                    _bossGarlands.Add(new SpriterSubstituteEntity(
                                          "xmas-" + _bossRelations[bossName].Item2 + "-" + bossName + "-garland.png",
                                          Animators["BossSelection"], Animators["Garland"].Clone()
                                          ));
                }

                var bossButton = new SpriterGuiButton(
                    Game.ViewportAdapter, bossName, "Graphics/GUI/BossSelection/xmas-" + bossName + "-available-button.png",
                    ballAnimator, Animators["BossSelection"]
                    );

                bossButton.Action += OnBossButtonAction;
                _bossButtons.Add(BossFactory.StringToBossType(bossName), bossButton);
            }

            // Boss panel buttons
            _closeBossPanelButton = new SpriterGuiButton(
                Game.ViewportAdapter, "CloseBossPanel", "Graphics/GUI/BossSelection/boss-panel-close-button.png",
                Animators["CloseButton"], Animators["BossPanel"]
                );

            _startBattleBossPanelButton = new SpriterGuiButton(
                Game.ViewportAdapter, "StartBattleBossPanel", "Graphics/GUI/BossSelection/boss-panel-battle-button.png",
                Animators["BattleButton"], Animators["BossPanel"]
                );

            _closeBossPanelButton.Action       += BossPanelCloseButtonAction;
            _startBattleBossPanelButton.Action += BossPanelStartBattleButtonAction;

            _closeBossPanelButton.Animator().zIndex(11);
            _startBattleBossPanelButton.Animator().zIndex(11);

            _bossPanelButtons.Add(_closeBossPanelButton);
            _bossPanelButtons.Add(_startBattleBossPanelButton);

            // Labels
            _bossNameLabel    = new SpriterGuiLabel("Unknown", Assets.GetFont("Graphics/Fonts/ui-title"), "boss-panel-title-label.png", Animators["BossPanel"], true);
            _bestTimeLabel    = new SpriterGuiLabel("", Assets.GetFont("Graphics/Fonts/ui"), "boss-panel-best-time-label.png", Animators["BossPanel"]);
            _playTimeLabel    = new SpriterGuiLabel("", Assets.GetFont("Graphics/Fonts/ui"), "boss-panel-play-time-label.png", Animators["BossPanel"]);
            _playerDeathLabel = new SpriterGuiLabel("", Assets.GetFont("Graphics/Fonts/ui"), "boss-panel-player-deaths-label.png", Animators["BossPanel"]);
            _bossDeathLabel   = new SpriterGuiLabel("", Assets.GetFont("Graphics/Fonts/ui"), "boss-panel-boss-deaths-label.png", Animators["BossPanel"]);

            _bossPanelLabels.Add(_bossNameLabel);
            _bossPanelLabels.Add(_bestTimeLabel);
            _bossPanelLabels.Add(_playTimeLabel);
            _bossPanelLabels.Add(_playerDeathLabel);
            _bossPanelLabels.Add(_bossDeathLabel);

            base.InitializeSpriterGui();

            ResetUI();
        }
        private void InitializeSpriterGui()
        {
            SpriterFile["Main"].AnimationFinished      += BossSelectionScreen_AnimationFinished;
            SpriterFile["BossPanel"].AnimationFinished += BossPanel_AnimationFinished;

            SpriterFile["Garland"].ZIndex(5);
            SpriterFile["BallHook"].ZIndex(6);
            SpriterFile["Ball"].ZIndex(9);
            SpriterFile["BossPanel"].ZIndex(10);

            // Christmas tree's balls
            foreach (var bossName in _bossNames)
            {
                var ballAnimator = SpriterFile["Ball"].Clone();
                var hasRelation  = _bossRelations.ContainsKey(bossName);

                for (int i = 0; i < 10; i++)
                {
                    _ballHooks.Add(new SpriterSubstituteEntity("garland-forbidden-ball.png", SpriterFile["Main"], SpriterFile["BallHook"].Clone(), "garland-forbidden-ball_00" + i));
                }

                if (hasRelation)
                {
                    var garlandAnimator1 = SpriterFile["Garland"].Clone();
                    var garlandAnimator2 = SpriterFile["Garland"].Clone();

                    garlandAnimator1.Play("FlashForbidden");
                    garlandAnimator2.Play("FlashForbidden");
                    garlandAnimator1.Speed    = 0.5f + (float)Game.GameManager.Random.NextDouble() / 2f;
                    garlandAnimator2.Speed    = 0.5f + (float)Game.GameManager.Random.NextDouble() / 2f;
                    garlandAnimator1.Progress = (float)Game.GameManager.Random.NextDouble();
                    garlandAnimator2.Progress = (float)Game.GameManager.Random.NextDouble();

                    _bossGarlands.Add(
                        _bossRelations[bossName].Item1 + "-" + bossName,
                        new SpriterSubstituteEntity(
                            "xmas-" + _bossRelations[bossName].Item1 + "-" + bossName + "-garland.png",
                            SpriterFile["Main"], garlandAnimator1
                            )
                        );

                    _bossGarlands.Add(
                        _bossRelations[bossName].Item2 + "-" + bossName,
                        new SpriterSubstituteEntity(
                            "xmas-" + _bossRelations[bossName].Item2 + "-" + bossName + "-garland.png",
                            SpriterFile["Main"], garlandAnimator2
                            )
                        );
                }

                var bossButton = new SpriterGuiButton(
                    Game.ViewportAdapter, bossName, "Graphics/GUI/BossSelection/xmas-" + bossName + "-available-button.png",
                    ballAnimator, SpriterFile["Main"], "Balance", null, "Audio/SE/select1"
                    );

                bossButton.SubstituteEntity.SubstituteAnimator.Progress = (float)Game.GameManager.Random.NextDouble();
                bossButton.SubstituteEntity.SubstituteAnimator.Speed    = 0.5f + (float)Game.GameManager.Random.NextDouble();

                bossButton.Action += OnBossButtonAction;
                _bossButtons.Add(BossFactory.StringToBossType(bossName), bossButton);
            }

            // Boss panel buttons
            var closeBossPanelButton = new SpriterGuiButton(
                Game.ViewportAdapter, "CloseBossPanel", "Graphics/GUI/BossSelection/boss-panel-close-button.png",
                SpriterFile["CloseButton"], SpriterFile["BossPanel"], "Idle", null, "Audio/SE/select4"
                );

            var startBattleBossPanelButton = new SpriterGuiButton(
                Game.ViewportAdapter, "StartBattleBossPanel", "Graphics/GUI/BossSelection/boss-panel-battle-button.png",
                SpriterFile["BattleButton"], SpriterFile["BossPanel"], "Idle", null, "Audio/SE/select2"
                );

            closeBossPanelButton.Action       += BossPanelCloseButtonAction;
            startBattleBossPanelButton.Action += BossPanelStartBattleButtonAction;

            closeBossPanelButton.Animator().ZIndex(11);
            startBattleBossPanelButton.Animator().ZIndex(11);

            _bossPanelButtons.Add(closeBossPanelButton);
            _bossPanelButtons.Add(startBattleBossPanelButton);

            // Labels
            _bossNameLabel    = new SpriterGuiLabel("Unknown", Assets.GetFont("Graphics/Fonts/ui-title"), "boss-panel-title-label.png", SpriterFile["BossPanel"], Vector2.Zero, true);
            _bestTimeLabel    = new SpriterGuiLabel("", Assets.GetFont("Graphics/Fonts/ui"), "boss-panel-best-time-label.png", SpriterFile["BossPanel"], Vector2.Zero);
            _playTimeLabel    = new SpriterGuiLabel("", Assets.GetFont("Graphics/Fonts/ui"), "boss-panel-play-time-label.png", SpriterFile["BossPanel"], Vector2.Zero);
            _playerDeathLabel = new SpriterGuiLabel("", Assets.GetFont("Graphics/Fonts/ui"), "boss-panel-player-deaths-label.png", SpriterFile["BossPanel"], Vector2.Zero);
            _bossDeathLabel   = new SpriterGuiLabel("", Assets.GetFont("Graphics/Fonts/ui"), "boss-panel-boss-deaths-label.png", SpriterFile["BossPanel"], Vector2.Zero);

            _bossPanelLabels.Add(_bossNameLabel);
            _bossPanelLabels.Add(_bestTimeLabel);
            _bossPanelLabels.Add(_playTimeLabel);
            _bossPanelLabels.Add(_playerDeathLabel);
            _bossPanelLabels.Add(_bossDeathLabel);

            ResetUI();
        }