private void WindowKeyDown(object sender, KeyEventArgs e)
        {
            var Map = new FoxDraw(canvas);

            if (e.Key == Key.W)
            {
                pos.Y -= 70;
                DrawCharacter.DrawHero(Map, pos.X, pos.Y);
                DrawCharacter.DrawCover(Map, pos.X, pos.Y + 70);
            }

            if (e.Key == Key.A)
            {
                pos.X -= 70;
                DrawCharacter.DrawHero(Map, pos.X, pos.Y);
                DrawCharacter.DrawCover(Map, pos.X + 70, pos.Y);
            }

            if (e.Key == Key.S)
            {
                pos.Y += 70;
                DrawCharacter.DrawHero(Map, pos.X, pos.Y);
                DrawCharacter.DrawCover(Map, pos.X, pos.Y - 70);
            }

            if (e.Key == Key.D)
            {
                pos.X += 70;
                DrawCharacter.DrawHero(Map, pos.X, pos.Y);
                DrawCharacter.DrawCover(Map, pos.X - 70, pos.Y);
            }
        }
Esempio n. 2
0
        static public double MoveIt(FoxDraw a)
        {
            double x = 0;
            double y = 0;

            DrawCharacter.DrawHero(a, x, y);
            return(x += 70);
        }