Exemple #1
0
        private Vector2 _previousPosition; // For resetting the position to the last one if a collision occurs

        #endregion Fields

        #region Constructors

        public Character(String name, Texture2D texture, int frameCount, int framesPerSec)
            : base(name, texture, frameCount, framesPerSec)
        {
            _applyGravity = true; // On creation, apply gravity
            _health = new Health(100, 1);
            _dead = false;
        }
Exemple #2
0
        public HealthBar(Texture2D texture, SpriteBatch sb)
        {
            _texture = texture;
            _position = new Vector2(200, 200);

            _health = new Health(100, 1);
            elapsedTime = 0;

            _rectangle = new Rectangle(0, 0, texture.Height, texture.Width);
            _spriteBatch = sb;
        }
Exemple #3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="name">Gem name</param>
 /// <param name="texture">For the base constructor</param>
 /// <param name="frameCount">For the animation</param>
 /// <param name="framesPerSec">For the animation speed</param>
 public Gem(String name, Texture2D texture, int frameCount, int framesPerSec)
     : base(name, texture, frameCount, framesPerSec)
 {
     _health = new Health(100, 1);
 }