private void WindowKeyDown(object sender, KeyEventArgs e) { map = new Map(); map.MapDrawer(foxDraw); if (e.Key == Key.Left) { hero.WalkLeft(foxDraw); } if (e.Key == Key.Right) { hero.WalkRight(foxDraw); } if (e.Key == Key.Up) { hero.WalkUp(foxDraw); } if (e.Key == Key.Down) { hero.WalkDown(foxDraw); } }
public MainWindow() { InitializeComponent(); foxDraw = new FoxDraw(canvas); map = new Map(); hero = new Hero(); map.MapDrawer(foxDraw); hero.HeroDrawer(foxDraw); }