Game-Design / Sprint3_actual / BorderElements / Healthbar.cs
Healthbar.cs
Raw
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using System;
using System.Collections.Generic;
using System.Text;
using Sprint3_actual.SpriteFactories;

namespace Sprint3_actual.BorderElements
{
    class Healthbar : IBorder
    {

        private ISprite sprite;
        private Rectangle posRectangle;
        private int health;

        public Healthbar(int x, int y, int health)
        {
            this.posRectangle = new Rectangle(x, y, 112 * 3, 24 * 3);
            this.health = health;
            this.sprite = BorderElementsSpriteFactory.Instance.CreateHealthbar(this, health);
        }

        public Rectangle getPos()
        {
            return posRectangle;
        }

        public Rectangle getHitbox()
        {
            return posRectangle;
        }

        public void DrawBorder()
        {
            sprite.draw();

        }

        public void UpdateBorder()
        {

        }

    }
}