Esempio n. 1
0
        /// <summary>
        ///     Updates the object.
        /// </summary>
        /// <param name="gameTime">The GameTime.</param>
        public void Update(GameTime gameTime)
        {
            float tSecond = gameTime.ElapsedGameTime / 1000f;
            float gravity = 12f;

            float velocity = gravity * tSecond;

            Velocity = new Vector2(Velocity.X, Velocity.Y + velocity);

            Position += Velocity;
            _spriteSheet.Update(gameTime);
        }
Esempio n. 2
0
        public override void Update(GameTime gameTime)
        {
            _light.Position = Position + new Vector2(32f, 56f);
            _accumulator   += gameTime.ElapsedGameTime.TotalMilliseconds;

            if (_accumulator >= 50)
            {
                if (_expand)
                {
                    _light.Scale += new Vector2(4);
                }
                else
                {
                    _light.Scale -= new Vector2(4);
                }

                _expand      = !_expand;
                _accumulator = 0;
            }

            _sheet.Update(gameTime);
        }