Ejemplo n.º 1
0
 protected override void OnUpdate()
 {
     if (IsPush(Key.W))
     {
         Move(Direction.Up);
     }
     else if (IsPush(Key.S))
     {
         Move(Direction.Down);
     }
     else if (IsPush(Key.D))
     {
         Move(Direction.Right);
     }
     else if (IsPush(Key.A))
     {
         Move(Direction.Left);
     }
     else if (IsPush(Key.Z))
     {
         OnPlayerInput?.Invoke(IPlayerAction.CreateBlock.Instance);
     }
     else if (IsPush(Key.X))
     {
         OnPlayerInput?.Invoke(IPlayerAction.BreakBlock.Instance);
     }
 }
Ejemplo n.º 2
0
 public void Move(Direction direction)
 {
     OnPlayerInput?.Invoke(new IPlayerAction.Move(direction));
 }