コード例 #1
0
 public MainWindow()
 {
     InitializeComponent();
     foxDraw = new FoxDraw(canvas);
     Map.DrawMap(foxDraw);
     map = new Map();
     Hero.SetHero(foxDraw);
 }
コード例 #2
0
        private void WindowKeyDown(object sender, KeyEventArgs e)
        {
            Map.DrawMap(foxDraw);
            if (e.Key == Key.Left)
            {
                Hero.MoveLeft(foxDraw);
            }

            if (e.Key == Key.Right)
            {
                Hero.MoveRight(foxDraw);
            }

            if (e.Key == Key.Down)
            {
                Hero.MoveDown(foxDraw);
            }

            if (e.Key == Key.Up)
            {
                Hero.MoveUp(foxDraw);
            }
        }