Update() private method

private Update ( ) : void
return void
Exemplo n.º 1
0
        public void Update(GameTime gameTime)
        {
            _animator.Update(gameTime.ElapsedGameTime.Milliseconds);

            if (_laser != null)
            {
                _laser.SetStartPoint(Position());
                _laser.SetEndPoint(Position() + Vector2.UnitY * GameConfig.VirtualResolution.Y);

                var scaleAmount = gameTime.GetElapsedSeconds() * 10f;
                if (_scaleDownLaser)
                {
                    _laser.ScaleX(_laser.ScaleVector().X - scaleAmount);
                }
                else
                {
                    _laser.ScaleX(_laser.ScaleVector().X + scaleAmount);
                }

                if (_scaleDownLaser && _laser.ScaleVector().X < 3f)
                {
                    _scaleDownLaser = false;
                }
                else if (_laser.ScaleVector().X > 4f)
                {
                    _scaleDownLaser = true;
                }

                _laser.Update(gameTime);
            }
        }
Exemplo n.º 2
0
 public override void Update(GameTime gameTime)
 {
     base.Update(gameTime);
     if (!InputHandler.KeyDown(shootKey) && !InputHandler.ButtonDown(Buttons.RightTrigger, owner.PlayerIndex))
     {
         laser.IsActive = false;
     }
     laser.Update(gameTime);
 }
Exemplo n.º 3
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            if (!_triggeredPattern &&
                Boss.Position().X == GameConfig.VirtualResolution.X / 2f &&
                Boss.Position().Y == GameConfig.VirtualResolution.Y / 2f)
            {
                TriggerPattern();
                _triggeredPattern = true;
            }

            _laser.Update(gameTime);
        }