public Sprite(Animation animation)
        {
            Animation = animation;
            Body = new RotatableRectangleF(Animation.MaxDimensions);

            Flip = SpriteEffects.None;
            Tint = Color.White;
            FramesPerSecond = 30;

            if (Animation.Animations.Count == 1)
            {
                var keys = new string[1];
                Animation.Animations.Keys.CopyTo(keys, 0);
                Key = keys[0];
            }
        }
Example #2
0
 public static void LoadContent(ContentManager content)
 {
     _animation = content.Load<Animation>("sprite/coin");
 }
 public static void LoadContent(ContentManager content)
 {
     _hitSound = content.Load<SoundEffect>("sfx/hit");
     _animation = content.Load<Animation>("sprite/slime");
     _hurtSound = content.Load<SoundEffect>("sfx/sword03");
 }