Ejemplo n.º 1
0
        /// <summary>
        /// Frame Renewal
        /// </summary>
        /// <param name="gameTime">Snapshot of Timing Values</param>
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            var stickDirection = GetThumbY();
            this.Direction = stickDirection < 0 ? PaddleDirection.Up : (stickDirection > 0 ? PaddleDirection.Down : PaddleDirection.None);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Frame Renewal
        /// </summary>
        /// <param name="gameTime">Snapshot of timing values</param>
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            this.Direction = PaddleDirection.None;

            //
            if (_inputManager.Keyboard.IsKeyDown(_up))
                this.Direction = PaddleDirection.Up;
            //
            if (_inputManager.Keyboard.IsKeyDown(_down))
                this.Direction = this.Direction == PaddleDirection.Up ? PaddleDirection.None : PaddleDirection.Down;
        }