Exemplo n.º 1
0
        /// <summary>
        /// Frame Renewal
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            base.Position = _source.Position;
            this.Rotation = _source.Rotation;

            if (_source.IsAlive == false)
            {
                if (_source.IsDying)
                {
                    this.Color = Color.Lerp(this.Color, Color.Transparent, (Single)gameTime.ElapsedGameTime.TotalSeconds * 15);
                }
                else
                {
                    this.Color = Color.Lerp(this.Color, Color.White, (Single)gameTime.ElapsedGameTime.TotalSeconds * 5);
                }

                this.Rotation = 0; // (Single)MathHelper.Lerp(this.Rotation, 0, (Single)gameTime.ElapsedGameTime.TotalSeconds * 10);
            }
            else
            {
                this.Color = Color.Lerp(this.Color, Color.White, (Single)gameTime.ElapsedGameTime.TotalSeconds * 5);
            }

            // TODO rotation smoothing
            //var degrees = Math.Round(this.Rotation * 180 / Math.PI, 1);
            //this.Rotation = (Single)(degrees * Math.PI / 180);

            if (_alert != null)
            {
                _alert.Update(gameTime);
                _alert.Position = this.Position;

                if (_alert.Enabled == false)
                {
                    _alert = null;
                }
            }

            if (_activeState != null)
            {
                _activeState.Update(gameTime);
                _activeState.Position = this.Position;
                _activeState.Visible  = true; //Settings.Get.ShowJumpInfo;

                if (_activeState.Enabled == false)
                {
                    _activeState = null;
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Frame Renewal
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            base.Position = _source.Position;

            // Update jump spots
            if (_jumpSpotLeft != null)
            {
                _jumpSpotLeft.Update(gameTime);
            }

            if (_jumpSpotRight != null)
            {
                _jumpSpotRight.Update(gameTime);
            }

            if (_jumpSpotAlert != null)
            {
                _jumpSpotAlert.Update(gameTime);
            }
        }