コード例 #1
0
        private void displayGrid_KeyDown(object sender, KeyEventArgs e)
        {
            var commands = String.Empty;

            if (e.Key == Key.Down)
            {
                commands = "b";
            }
            else if (e.Key == Key.Up)
            {
                commands = "f";
            }
            else if (e.Key == Key.Right)
            {
                commands = "r";
            }
            else if (e.Key == Key.Left)
            {
                commands = "l";
            }

            rover.TakeCommands(commands);
            PlaceRover();
        }