Exemplo n.º 1
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            var lastPressedKey = Keyboard.GetState().GetPressedKeys().LastOrDefault();

            ShiftMechanics?.HandleEvent(this, new ShiftEventArgs()
            {
                GameTime  = gameTime,
                Direction = ShiftingDirection.FromKey(lastPressedKey)
            });

            FallMechanics?.HandleEvent(this, new FallEventArgs()
            {
                GameTime = gameTime
            });

            RotateMechanics?.HandleEvent(this, new RotateEventArgs()
            {
                GameTime  = gameTime,
                Direction = RotatingDirection.FromKey(lastPressedKey)
            });
        }