Ejemplo n.º 1
0
        public override void LoadContent(ContentManager content)
        {
            base.LoadContent(content);

            Animationen.Textur = content.Load <Texture2D>("Assets/zombie_tilesheet");

            var stehanimation = new Animation("Stehen");

            stehanimation.Breite = 80;
            stehanimation.Höhe   = 110;
            stehanimation.AddFrame(0);

            Animationen.AddAnimation(stehanimation);

            var laufanimation = new Animation("Laufen");

            laufanimation.Breite = 80;
            laufanimation.Höhe   = 110;
            laufanimation.AddFrame(9);
            laufanimation.AddFrame(10);

            Animationen.AddAnimation(laufanimation);

            Animationen.Play("Stehen");
        }
Ejemplo n.º 2
0
        public void Move(Vector2 delta)
        {
            Position += delta;

            Animationen.Play("Laufen");

            if (richtung == 0)
            {
                Effects = SpriteEffects.FlipHorizontally;
            }
            else if (richtung == 1)
            {
                Effects = SpriteEffects.None;
            }
        }