Exemple #1
0
        private void RestartScene()
        {
            // Interface
            gameUI.Revive();

            Registry.AudioManager.MusicVolume = 1.0f;
            if (_levelType == LevelType.Interior)
            {
                Registry.AudioManager.PlayMusic("Audio/DST-ConFuze", true);
            }
            else
            {
                Registry.AudioManager.PlayMusic("Audio/DST-DXT", true);
            }

            // Joueurs
            _player.Revive();

            // Aliens
            _ennemyManager.Revive();

            // Score
            Registry.Players[0].GameScore.Score = 0;

            // Bonus
            bonusGroup.Clear();

            // MessageBox
            messageBoxManager.DesactiveMessageBoxes();

            _looseTimer.Restart();
        }
        public override void AddDamage(float damages)
        {
            base.AddDamage(damages);

            Registry.GameUI.UpdateHealthSatus((int)_playerIndex, GetHealthPercent());
            Registry.GameUI.UpdateShieldStatus((int)_playerIndex, GetShieldPercent());

            _playerTouchedTimer.Restart();
        }
Exemple #3
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

#if COMPLETE
            if (kinect.IsAvailable)
            {
                _timerKinectOver.Update(gameTime);

                Vector3 hand = kinect.GetUserProfile(KinectPlayerIndex.One).HandRight;
                _handSelector.Position = new Vector2(hand.X, hand.Y);

                foreach (MenuItem item in items)
                {
                    if (CheckKinectOver(item, (int)hand.X, (int)hand.Y))
                    {
                        item_MouseOver(item, new MouseOverSpriteEventArgs((int)hand.X, (int)hand.Y));

                        if (_kinectValidedAction)
                        {
                            item_MouseJustClicked(item, new MouseClickSpriteEventArgs((int)hand.X, (int)hand.Y, Yna.Input.MouseButton.Left, true, false));
                        }

                        if (_timerKinectOver.Active)
                        {
                            _transitionKinectOver.Update(gameTime);
                            _handSelector.Alpha = _transitionKinectOver.Alpha;
                        }
                        else
                        {
                            _timerKinectOver.Restart();
                        }
                    }

                    else if (CheckKinectLeave(item, (int)_lastKinectPosition.X, (int)_lastKinectPosition.Y, (int)hand.X, (int)hand.Y))
                    {
                        item_MouseLeave(item, new MouseLeaveSpriteEventArgs((int)_lastKinectPosition.X, (int)_lastKinectPosition.Y, (int)hand.X, (int)hand.Y));
                        _timerKinectOver.Stop();
                        _handSelector.Color  = Color.White;
                        _handSelector.Alpha  = 1.0f;
                        _kinectValidedAction = false;
                    }
                }

                _lastKinectPosition = hand;
            }
            else
            {
                _handSelector.Position = new Vector2(YnG.Mouse.X, YnG.Mouse.Y);
            }
#else
            _handSelector.Position = new Vector2(YnG.Mouse.X, YnG.Mouse.Y);
#endif
        }
Exemple #4
0
        void spawnTimer_ReStarted()
        {
            Random random    = new Random(DateTime.Now.Millisecond);
            int    weaveType = random.Next(0, 3);
            int    weaveSize = random.Next(2, 8);

            if (weaveType == 1)
            {
                AddWeaveTypeA(weaveSize);
            }
            else
            {
                AddWeaveTypeB(weaveSize);
            }

            spawnTimer.Restart();
        }