示例#1
0
 private void Form1_KeyUp(object sender, KeyEventArgs e)
 {
     if (game != null)
     {
         if (e.KeyCode == Keys.Up)
         {
             game.Move(Directions.Up);
             return;
         }
         if (e.KeyCode == Keys.Down)
         {
             game.Move(Directions.Down);
             return;
         }
         if (e.KeyCode == Keys.Right)
         {
             game.Move(Directions.Right);
             return;
         }
         if (e.KeyCode == Keys.Left)
         {
             game.Move(Directions.Left);
             return;
         }
     }
 }