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)
            });
        }
Exemplo n.º 2
0
 public void SetRotatingDirection(MotorSelection motors, RotatingDirection direction)
 {
     lock (this)
     {
         SendCommand(new byte[] { (byte)RNCommands.SetRotationDirection, (byte)motors, (byte)direction });
     }
 }