예제 #1
0
        public void BossPlayTime(BossType type, TimeSpan value)
        {
#if ANDROID
            _preferencesEditor.PutString("BossPlayTime-" + type.ToString(), value.TotalSeconds.ToString());
            _preferencesEditor.Apply();
#endif
        }
예제 #2
0
        public void BossAttempts(BossType type, int value)
        {
#if ANDROID
            _preferencesEditor.PutInt("BossAttempts-" + type.ToString(), value);
            _preferencesEditor.Apply();
#endif
        }
예제 #3
0
        // Boss specific data

        public void BossBeatenCounter(BossType type, int value)
        {
#if ANDROID
            _preferencesEditor.PutInt("BossBeatenCounter-" + type.ToString(), value);
            _preferencesEditor.Apply();
#endif
        }
예제 #4
0
        public int BossAttempts(BossType type)
        {
#if ANDROID
            return(_preferences.GetInt("BossAttempts-" + type.ToString(), 0));
#else
            return(0);
#endif
        }
예제 #5
0
        public int BossBeatenCounter(BossType type)
        {
#if ANDROID
            return(_preferences.GetInt("BossBeatenCounter-" + type.ToString(), 0));
#else
            return(0);
#endif
        }
예제 #6
0
        private void OpenBossPanel(BossType bossType)
        {
            _selectedBoss = bossType;

            var spriterGuiButton = _bossButtons[bossType];

            spriterGuiButton.SubstituteEntity.EnableSynchronization(false);
            var ballPosition = Game.ViewportAdapter.Center.ToVector2();

            ballPosition.Y -= 575;
            spriterGuiButton.Animator().Position = ballPosition;
            spriterGuiButton.Animator().Scale    = new Vector2(2f);
            spriterGuiButton.Animator().ZIndex(11);

            foreach (var bossPanelButton in _bossPanelButtons)
            {
                Game.GuiManager.AddButton(bossPanelButton);
            }

            foreach (var bossPanelLabel in _bossPanelLabels)
            {
                Game.GuiManager.AddLabel(bossPanelLabel);
            }

            Game.SpriteBatchManager.AddSpriterAnimator(SpriterFile["BossPanel"], Layer.UI);
            SpriterFile["BossPanel"].Play("Show");

            // Update labels
            var bossDeath = Game.PlayerData.BossBeatenCounter(bossType);

            _bossNameLabel.Text    = "Xmas " + bossType.ToString().Substring(4);
            _bestTimeLabel.Text    = "Best time: ";
            _bestTimeLabel.Text   += (bossDeath > 0) ? Game.PlayerData.BossBestTime(bossType).ToString("mm\\:ss") : "--:--";
            _playTimeLabel.Text    = "Play time: " + Game.PlayerData.BossPlayTime(bossType).ToString("mm\\:ss");
            _playerDeathLabel.Text = "Attempts: " + (Game.PlayerData.DeathCounter(bossType) + Game.PlayerData.BossBeatenCounter(bossType)).ToString("000");
            _bossDeathLabel.Text   = "Boss deaths: " + bossDeath;

            DoOpenBossPanel();
        }
예제 #7
0
 public TimeSpan BossPlayTime(BossType type)
 {
     return(TimeSpan.FromSeconds(_preferences.GetFloat("BossPlayTime-" + type.ToString(), 0)));
 }
예제 #8
0
 public void BossPlayTime(BossType type, TimeSpan value)
 {
     _preferences.Editor().PutFloat("BossPlayTime-" + type.ToString(), (float)value.TotalSeconds);
     _preferences.Editor().Apply();
 }
예제 #9
0
 public int DeathCounter(BossType type)
 {
     return(_preferences.GetInt("DeathCounter-" + type.ToString(), 0));
 }
예제 #10
0
 public void DeathCounter(BossType type, int value)
 {
     _preferences.Editor().PutInt("DeathCounter-" + type.ToString(), value);
     _preferences.Editor().Apply();
 }
예제 #11
0
        public TimeSpan BossBestTime(BossType type)
        {
#if ANDROID
            return(TimeSpan.FromSeconds(double.Parse(_preferences.GetString("BossBestTime-" + type.ToString(), "0"))));
#else
            return(TimeSpan.Zero);
#endif
        }