Ejemplo n.º 1
0
 public Goomba(Level level, Vector2 startPosition)
     : base(level, startPosition)
 {
     Texture = level.Content.Load<Texture2D>("Goomba");
     Size = new Vector2(16, 16);
     Speed = new Vector2(1.0f, 3.0f);
     Direction = Direction.Left;
     Sprite = new Animator();
     Animations = new[]
         {
             new Animation(this, AnimationType.Run,   2, 0.5f, true),
             new Animation(this, AnimationType.Death, 1, 0.5f, false)
         }.ToDictionary(x => x.AnimationType);
     Sprite.SetAnimation(Animations[AnimationType.Run]);
 }
Ejemplo n.º 2
0
        public Player(Level level)
            : base(level)
        {
            Texture = Level.Content.Load<Texture2D>("Mario");
            CurrentPosition = Level.StartPosition;
            Size = new Vector2(16, 16);
            Speed = new Vector2(5.0f, 3.3f);

            Sprite = new Animator();
            Animations = new[]
                {
                    new Animation(this, AnimationType.Stand, 1, 0.5f, false),
                    new Animation(this, AnimationType.Run,   2, 0.25f, true),
                    new Animation(this, AnimationType.Jump,  2, 0.5f, false),
                    new Animation(this, AnimationType.Death, 1, 0.5f, false),
                    new Animation(this, AnimationType.Skid,  1, 0.5f, false)
                }.ToDictionary(x => x.AnimationType);
            Sprite.SetAnimation(Animations[AnimationType.Stand]);
        }