Esempio n. 1
0
 public void AddGroup(AnimationGroup animationGroup)
 {
     _animationGroups.Add(animationGroup);
 }
Esempio n. 2
0
 public void RemoveGroup(AnimationGroup animationGroup)
 {
     _animationGroups.Remove(animationGroup);
 }
Esempio n. 3
0
        public ParticleSystem(Game game, Player player, bool isSand = false)
            : base(game)
        {
            DrawOrder = 50;
            Player = player;
            Particles = new Dictionary<string, Particle>(1000);
            IsSand = isSand;
            _particleQueue = new HashSet<Particle>();
            _createParticleQueue = new HashSet<Particle>();

            if(IsSand)
            {
                _fireParticles = new ParticleSystem(Game, Player);

                Children.Add(_fireParticles);

                _burningSound = Storage.Sound("SandBurning").CreateInstance();
                _burningSound.Volume = 0.0f;
                _burningSound.IsLooped = true;
                _burningSound.Play();

                _updateRemoteSandTimer = new Animation { CompletedDelegate = UpdateRemoteSand };
                _updateRemoteSandTimerGroup = new AnimationGroup(_updateRemoteSandTimer, 60) { Loops = true };

                Storage.AnimationController.AddGroup(_updateRemoteSandTimerGroup);
            }
        }
Esempio n. 4
0
        private void DecrementCounter()
        {
            CurrentValue--;

            if(CurrentValue == 0)
            {
                Storage.AnimationController.RemoveGroup(_countdownAnimationGroup);
                _countdownAnimation = null;
                _countdownAnimationGroup = null;

                if(_completeDelegate != null)
                {
                    _completeDelegate();
                }
            }
        }
Esempio n. 5
0
        public void Start(int num, int ms, CountdownComplete completeDelegate)
        {
            if(Storage.DebugMode)
            {
                ms = ms / 10;
            }

            _maxValue = CurrentValue = num;
            _frameTime = ms;
            _completeDelegate = completeDelegate;

            if(_countdownAnimationGroup != null)
            {
                Storage.AnimationController.RemoveGroup(_countdownAnimationGroup);
                _countdownAnimation = null;
                _countdownAnimationGroup = null;
            }

            _countdownAnimation = new Animation { CompletedDelegate = DecrementCounter };
            _countdownAnimationGroup = new AnimationGroup(_countdownAnimation, ms) { Loops = true };

            Storage.AnimationController.AddGroup(_countdownAnimationGroup);
        }
Esempio n. 6
0
        public void WinPulse(Team team, Button.Action completedAction)
        {
            _winPulseTeam = team;
            _winPulseAnimation = new Animation(this, "PulseValue", 0.0f, 10.0f, Easing.EaseInOut, EasingType.Linear);
            _winPulseAnimationGroup = new AnimationGroup(_winPulseAnimation, 10000.0f) {Loops = true};

            Storage.AnimationController.AddGroup(_winPulseAnimationGroup);
        }
Esempio n. 7
0
 public void EndWinPulse()
 {
     if(_winPulseAnimationGroup != null)
     {
         Storage.AnimationController.RemoveGroup(_winPulseAnimationGroup);
         _winPulseAnimationGroup = null;
         _winPulseAnimation = null;
     }
 }